]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
22 months agoMerge pull request #13825 from sri-mohan1/srib-ripng
Mark Stapp [Wed, 21 Jun 2023 20:27:01 +0000 (16:27 -0400)]
Merge pull request #13825 from sri-mohan1/srib-ripng

ripngd: changes for code maintainability

22 months agoMerge pull request #13731 from cyberstorm-mauritius/cid1519841
mobash-rasool [Wed, 21 Jun 2023 17:45:41 +0000 (23:15 +0530)]
Merge pull request #13731 from cyberstorm-mauritius/cid1519841

vrrp: check return value for turning off multicast for v6

22 months agoripngd: changes for code maintainability
sri-mohan1 [Wed, 21 Jun 2023 16:56:43 +0000 (22:26 +0530)]
ripngd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
22 months agoMerge pull request #13797 from sri-mohan1/srib-ripng
Donatas Abraitis [Wed, 21 Jun 2023 14:00:00 +0000 (17:00 +0300)]
Merge pull request #13797 from sri-mohan1/srib-ripng

ripngd: changes for code maintainability

22 months agoMerge pull request #13790 from pguibert6WIND/set_aspath_exclude
Russ White [Wed, 21 Jun 2023 12:48:21 +0000 (08:48 -0400)]
Merge pull request #13790 from pguibert6WIND/set_aspath_exclude

bgpd: add 'set as-path exclude all' command

22 months agoMerge pull request #13780 from opensourcerouting/fix/use_sync_zapi_for_labels
Mark Stapp [Wed, 21 Jun 2023 11:49:07 +0000 (07:49 -0400)]
Merge pull request #13780 from opensourcerouting/fix/use_sync_zapi_for_labels

bgpd: Use synchronous way to get labels from Zebra

22 months agozebra: Ignore non GR-aware zclient handling for BGP
Donatas Abraitis [Mon, 19 Jun 2023 15:35:52 +0000 (18:35 +0300)]
zebra: Ignore non GR-aware zclient handling for BGP

This is for synchronous client (label/table manager) - aka session_id == 1.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Do not initialize global variable zclient_sync to NULL
Donatas Abraitis [Mon, 19 Jun 2023 14:30:16 +0000 (17:30 +0300)]
bgpd: Do not initialize global variable zclient_sync to NULL

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agozebra: Show session id when printing an error when the client disconnects
Donatas Abraitis [Sun, 18 Jun 2023 19:07:54 +0000 (22:07 +0300)]
zebra: Show session id when printing an error when the client disconnects

Before:

```
2023/06/18 22:00:42 ZEBRA: [VXKFG-8SJRV][EC 4043309121] Client 'bgp' encountered an error and is shutting down.
2023/06/18 22:00:42 ZEBRA: [VXKFG-8SJRV][EC 4043309121] Client 'bgp' encountered an error and is shutting down.
```

After:

```
2023/06/18 22:06:44 ZEBRA: [N5M5Y-J5BPG][EC 4043309121] Client 'bgp' (session id 0) encountered an error and is shutting down.
2023/06/18 22:06:44 ZEBRA: [N5M5Y-J5BPG][EC 4043309121] Client 'bgp' (session id 1) encountered an error and is shutting down.
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Reuse bgp_zebra_label_manager_ready() helper function
Donatas Abraitis [Sat, 17 Jun 2023 06:26:52 +0000 (09:26 +0300)]
bgpd: Reuse bgp_zebra_label_manager_ready() helper function

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Retry connecting to synchronouse label manager if not ready
Donatas Abraitis [Sat, 17 Jun 2023 06:21:55 +0000 (09:21 +0300)]
bgpd: Retry connecting to synchronouse label manager if not ready

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Use synchronous way to get labels from Zebra
Donatas Abraitis [Mon, 12 Jun 2023 14:09:52 +0000 (17:09 +0300)]
bgpd: Use synchronous way to get labels from Zebra

Both the label manager and table manager zapi code send data requests via zapi
to zebra and then immediately listen for a response from zebra. The problem here
is of course that the listen part is throwing away any zapi command that is not
the one it is looking for.

ISIS/OSPF and PIM all have synchronous abilities via zapi, which they all
do through a special zapi connection to zebra. BGP needs to follow this model
as well. Additionally the new zclient_sync connection that should be created,
a once a second timer should wake up and read any data on the socket to
prevent problems too much data accumulating in the socket.

```
r3# sh bgp labelpool summary
Labelpool Summary
-----------------
Ledger:       3
InUse:        3
Requests:     0
LabelChunks:  1
Pending:      128
Reconnects:   1
r3# sh bgp labelpool inuse
Prefix                Label
---------------------------
10.0.0.1/32           16
192.168.31.0/24       17
192.168.32.0/24       18
r3#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agotests: Adjust tests for BGP LU labelpool output
Donatas Abraitis [Tue, 13 Jun 2023 19:12:39 +0000 (22:12 +0300)]
tests: Adjust tests for BGP LU labelpool output

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #13801 from LabNConsulting/chopps/latest-checkpatch
Jafar Al-Gharaibeh [Tue, 20 Jun 2023 15:41:01 +0000 (10:41 -0500)]
Merge pull request #13801 from LabNConsulting/chopps/latest-checkpatch

Import latest checkpatch.pl from linux

22 months agoMerge pull request #13800 from idryzhov/fix-rip-ripd-crash
Russ White [Tue, 20 Jun 2023 14:40:52 +0000 (10:40 -0400)]
Merge pull request #13800 from idryzhov/fix-rip-ripd-crash

fix crashes in rip and ripng

22 months agoMerge pull request #13809 from LabNConsulting/chopps/mgmtdoc
Jafar Al-Gharaibeh [Tue, 20 Jun 2023 14:04:55 +0000 (09:04 -0500)]
Merge pull request #13809 from LabNConsulting/chopps/mgmtdoc

doc: start of mgmtd developer doc

22 months agoMerge pull request #13811 from dpward/ospfv3-seqnum-wrap
Russ White [Tue, 20 Jun 2023 13:26:19 +0000 (09:26 -0400)]
Merge pull request #13811 from dpward/ospfv3-seqnum-wrap

ospf6d: Increment sequence number correctly in Authentication Trailer

22 months agoMerge pull request #13728 from opensourcerouting/fix/addpath_drop_non_best_addpaths
Russ White [Tue, 20 Jun 2023 13:20:36 +0000 (09:20 -0400)]
Merge pull request #13728 from opensourcerouting/fix/addpath_drop_non_best_addpaths

bgpd: Implement neighbor X addpath-tx-best-selected command

22 months agoMerge pull request #13750 from louis-6wind/fix-no-retain-memory-usage
Russ White [Tue, 20 Jun 2023 13:19:50 +0000 (09:19 -0400)]
Merge pull request #13750 from louis-6wind/fix-no-retain-memory-usage

bgpd: fix memory usage of vpn no retain

22 months agoMerge pull request #13758 from cscarpitta/bugfix/fix-read-beyond-stream-isis-asla
Russ White [Tue, 20 Jun 2023 13:19:23 +0000 (09:19 -0400)]
Merge pull request #13758 from cscarpitta/bugfix/fix-read-beyond-stream-isis-asla

isisd: Fix read beyond end of stream of ASLA Sub-TLV parsing

22 months agoMerge pull request #13769 from opensourcerouting/fix/bgp_peer-group_show_advertised
Russ White [Tue, 20 Jun 2023 13:18:52 +0000 (09:18 -0400)]
Merge pull request #13769 from opensourcerouting/fix/bgp_peer-group_show_advertised

bgpd: Allow using peer-group for listing advertised-routes, etc.

22 months agoMerge pull request #13665 from pguibert6WIND/issue_13616_pr
Russ White [Tue, 20 Jun 2023 13:18:16 +0000 (09:18 -0400)]
Merge pull request #13665 from pguibert6WIND/issue_13616_pr

topotests: label per nexthop test adds add a while loop for mpls table

22 months agoMerge pull request #13666 from pguibert6WIND/issue_13638_pr
Russ White [Tue, 20 Jun 2023 13:17:51 +0000 (09:17 -0400)]
Merge pull request #13666 from pguibert6WIND/issue_13638_pr

topotests: structural issues in bgp_local_as_dotplus_private_remove

22 months agoMerge pull request #13524 from pguibert6WIND/mpls_vpn_lsr_redistribute
Russ White [Tue, 20 Jun 2023 13:13:33 +0000 (09:13 -0400)]
Merge pull request #13524 from pguibert6WIND/mpls_vpn_lsr_redistribute

MPLS vpn LSR redistribute

22 months agoMerge pull request #13557 from anlancs/fix/bgpd-evpn-rmac-best-path
Russ White [Tue, 20 Jun 2023 13:12:51 +0000 (09:12 -0400)]
Merge pull request #13557 from anlancs/fix/bgpd-evpn-rmac-best-path

bgpd: Fix missing deletion of evpn routes

22 months agoMerge pull request #13394 from mjstapp/fix_zebra_mpls_config
Russ White [Tue, 20 Jun 2023 13:10:53 +0000 (09:10 -0400)]
Merge pull request #13394 from mjstapp/fix_zebra_mpls_config

zebra: clarify interface-level mpls config

22 months agoMerge pull request #12971 from taspelund/trey/mac_vrf_soo_upstream
Russ White [Tue, 20 Jun 2023 13:08:28 +0000 (09:08 -0400)]
Merge pull request #12971 from taspelund/trey/mac_vrf_soo_upstream

bgpd: Add MAC-VRF Site-of-Origin support

22 months agoMerge pull request #13810 from chiragshah6/fdev2
mobash-rasool [Tue, 20 Jun 2023 07:15:18 +0000 (12:45 +0530)]
Merge pull request #13810 from chiragshah6/fdev2

vrrpd: add priority field into interface json

22 months agotopotests: label per nexthop test adds add a while loop for mpls table
Philippe Guibert [Fri, 2 Jun 2023 08:55:07 +0000 (10:55 +0200)]
topotests: label per nexthop test adds add a while loop for mpls table

The bgp_vpnv4_per_nexthop_label tests only check to see if the mpls labels
are installed one time. Test runs show that all but one label is installed.
More than likely the test has asked for data while zebra is still installing
it. the mpls_label_check functions must check this result multiple times as
that system may be under heavy load.

A loop is introduced in order to let zebra check the mpls table.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agotopotests: structural issues in bgp_local_as_dotplus_private_remove
Philippe Guibert [Fri, 2 Jun 2023 10:05:18 +0000 (12:05 +0200)]
topotests: structural issues in bgp_local_as_dotplus_private_remove

This test has several issues:
A) The convergence function is spamming the show neighbor command until success,
if the neighbor never comes up the test will never finish. This adds unnecessary
load to an already loaded test system.  Use run_and_expect to properly wait for
the neighbor relationship to come up.
B) The convergence function should not sleep for 1 second *After* the neighbor
is established
C) The _bgp_as_path() function fails if the prefix has not been received yet.
This looking for the prefix data should be within a run_and_expect() functionality.
Else a loaded test system will fail in this function because while we may be in
an established state, prefixes might not yet have been exchanged and there is no
point in failing the test without giving the system some time to actually converge.

Fix those points, similarly to what has been fixed in
bgp_local_as_private_remove test.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agotools: checkpatch: FRR modifications to linux checkpatch.pl
Christian Hopps [Thu, 15 Jun 2023 20:07:31 +0000 (16:07 -0400)]
tools: checkpatch: FRR modifications to linux checkpatch.pl

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agodoc: add the linux doc for checkpatch.pl
Christian Hopps [Tue, 20 Jun 2023 05:03:46 +0000 (01:03 -0400)]
doc: add the linux doc for checkpatch.pl

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agotools: unmodified import of scripts/checkpatch.pl from linux
Christian Hopps [Thu, 15 Jun 2023 17:37:14 +0000 (13:37 -0400)]
tools: unmodified import of scripts/checkpatch.pl from linux

0ee3e7b8893e * checkpatch: get default codespell dictionary path from package location

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agodoc: start of mgmtd developer doc
Christian Hopps [Mon, 19 Jun 2023 08:57:48 +0000 (04:57 -0400)]
doc: start of mgmtd developer doc

- docs on how to convert daemon to mgmtd and some diagrams
- and a fix for code-block in cspf.rst

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agoospf6d: Increment sequence number correctly in Authentication Trailer
David Ward [Mon, 19 Jun 2023 20:00:38 +0000 (16:00 -0400)]
ospf6d: Increment sequence number correctly in Authentication Trailer

According to RFC 7166, the sequence number should be treated as an
unsigned 64-bit value, although it is stored as two 32-bit values.

When incrementing it, the code caused the lower-order 32-bit value
to skip from 0xFFFFFFFE to 0. As a side effect, an error was never
produced if the full 64-bit sequence number wrapped.

Fixes: #13805
Signed-off-by: David Ward <david.ward@ll.mit.edu>
22 months agovrrpd: add priority field into interface json
Sindhu Parvathi Gopinathan [Mon, 19 Jun 2023 07:56:35 +0000 (00:56 -0700)]
vrrpd: add priority field into interface json

'Priority' attribute is missing in "show vrrp interface <intf> json"
output. Whereas it is there in non-json output.

It has been added now in show vrrp interface json output.

Before Fix:

```
vrrp1# show vrrp interface swp5.101 json
[
  {
    "vrid":2,
    "version":3,
    "autoconfigured":false,
    "shutdown":false,
    "preemptMode":true,
    "acceptMode":true,
    "interface":"swp5.101",
    "advertisementInterval":1000,
    "v4":{
      "interface":"vrrp4-11-2",
      "vmac":"00:00:5e:00:01:02",
      "primaryAddress":"50.0.0.2",
      "status":"Master",
      "effectivePriority":110,
      "masterAdverInterval":1000,
      "skewTime":570,
      "masterDownInterval":3570,
      "stats":{
        "adverTx":248456,
        "adverRx":1,
        "garpTx":1,
        "transitions":2
      },
      "addresses":[
        "50.0.0.1"
      ]
    },
    "v6":{
      "interface":"vrrp6-11-2",
      "vmac":"00:00:5e:00:02:02",
      "primaryAddress":"fe80::7f1:49e7:768c:aa73",
      "status":"Master",
      "effectivePriority":110,
      "masterAdverInterval":1000,
      "skewTime":570,
      "masterDownInterval":3570,
      "stats":{
        "adverTx":248455,
        "adverRx":1,
        "neighborAdverTx":1,
        "transitions":2
      },
      "addresses":[
        "2001:50::1"
      ]
    }
  }
]
vrrp1#
```

After Fix:

```
vrrp1# show vrrp interface swp5.101 json
[
  {
    "vrid":2,
    "version":3,
    "autoconfigured":false,
    "shutdown":false,
    "preemptMode":true,
    "acceptMode":true,
    "interface":"swp5.101",
    "advertisementInterval":1000,
    "priority":110, ====> priority added into json output
    "v4":{
      "interface":"vrrp4-11-2",
      "vmac":"00:00:5e:00:01:02",
      "primaryAddress":"50.0.0.2",
      "status":"Master",
      "effectivePriority":110,
      "masterAdverInterval":1000,
      "skewTime":570,
      "masterDownInterval":3570,
      "stats":{
        "adverTx":15,
        "adverRx":4,
        "garpTx":1,
        "transitions":2
      },
      "addresses":[
        "50.0.0.1"
      ]
    },
    "v6":{
      "interface":"vrrp6-11-2",
      "vmac":"00:00:5e:00:02:02",
      "primaryAddress":"fe80::7f1:49e7:768c:aa73",
      "status":"Master",
      "effectivePriority":110,
      "masterAdverInterval":1000,
      "skewTime":570,
      "masterDownInterval":3570,
      "stats":{
        "adverTx":13,
        "adverRx":5,
        "neighborAdverTx":1,
        "transitions":2
      },
      "addresses":[
        "2001:50::1"
      ]
    }
  }
]
```

Ticket:#3502432

Issue:3502432

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
22 months agobgpd: add 'set as-path exclude all' command
Philippe Guibert [Tue, 13 Jun 2023 12:53:03 +0000 (14:53 +0200)]
bgpd: add 'set as-path exclude all' command

It is not possible to flush all the incoming as-path list
from a given BGP update.

Add a route-map set command to remove all as-paths
from a given AS path. Add the necessary tests.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agoripngd: changes for code maintainability
sri-mohan1 [Wed, 14 Jun 2023 18:24:07 +0000 (23:54 +0530)]
ripngd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
22 months agoMerge pull request #13798 from donaldsharp/bgp_suppression
Donatas Abraitis [Sun, 18 Jun 2023 08:58:08 +0000 (11:58 +0300)]
Merge pull request #13798 from donaldsharp/bgp_suppression

bgpd: some safi's do not mix with bgp suppress-fib

22 months agoMerge pull request #13765 from AbhishekNR/query-max-response-time
Donatas Abraitis [Sun, 18 Jun 2023 08:48:29 +0000 (11:48 +0300)]
Merge pull request #13765 from AbhishekNR/query-max-response-time

pim6d: Correcting the help string

22 months agoMerge pull request #13796 from anlancs/doc-wrong-code-block
Donatas Abraitis [Sun, 18 Jun 2023 08:35:29 +0000 (11:35 +0300)]
Merge pull request #13796 from anlancs/doc-wrong-code-block

doc: Fix one syntax error for code block

22 months agotopotests: import vpn to default vrf in bgp_vpnv4_noretain
Louis Scalbert [Thu, 8 Jun 2023 11:42:30 +0000 (13:42 +0200)]
topotests: import vpn to default vrf in bgp_vpnv4_noretain

Test that importing VPN prefixes into the default VRF is possible with
the no retain feature.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: more tests in bgp_vpnv4_noretain
Louis Scalbert [Thu, 8 Jun 2023 11:42:30 +0000 (13:42 +0200)]
topotests: more tests in bgp_vpnv4_noretain

Add more VRFs in bgp_vpnv4_noretain and test combinations of no-retain
/ retain and import / un-import.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: check protocol convergence at init in bgp_vpnv4_noretain
Louis Scalbert [Wed, 14 Jun 2023 09:05:01 +0000 (11:05 +0200)]
topotests: check protocol convergence at init in bgp_vpnv4_noretain

Check that the BGP session is Established before starting the tests.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: check r2 vpn table in bgp_vpnv4_noretain
Louis Scalbert [Thu, 8 Jun 2023 12:34:22 +0000 (14:34 +0200)]
topotests: check r2 vpn table in bgp_vpnv4_noretain

Remove no retain in r2 and check that r2 VPN table remains the same
after r1 configuration changes.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: do not import r1 vrf1 to itself bgp_vpnv4_noretain
Louis Scalbert [Thu, 8 Jun 2023 12:27:12 +0000 (14:27 +0200)]
topotests: do not import r1 vrf1 to itself bgp_vpnv4_noretain

Do not import r1 vrf1 to itself in order to check that r1 vrf1 prefixes
are only in VPN table because it is needed for advertising the prefixes
to other routers.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: filter out void RD in bgp_vpnv4_noretain
Louis Scalbert [Thu, 8 Jun 2023 10:52:44 +0000 (12:52 +0200)]
topotests: filter out void RD in bgp_vpnv4_noretain

Filter out route-distinguishers that have no prefix in "show bgp table
json"

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: router relative variables in bgp_vpnv4_noretain
Louis Scalbert [Thu, 8 Jun 2023 10:27:18 +0000 (12:27 +0200)]
topotests: router relative variables in bgp_vpnv4_noretain

Change IP addresses, label, RD and RT to match the router number
and VRF number.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: apply style to bgp_vpnv4_noretain
Louis Scalbert [Tue, 6 Jun 2023 15:52:11 +0000 (17:52 +0200)]
topotests: apply style to bgp_vpnv4_noretain

Apply style cosmetic changes to bgp_vpnv4_noretain with "black".

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agotopotests: cosmetic changes to bgp_vpnv4_noretain
Louis Scalbert [Tue, 6 Jun 2023 15:00:18 +0000 (17:00 +0200)]
topotests: cosmetic changes to bgp_vpnv4_noretain

Cosmetic changes to bgp_vpnv4_noretain to prepare the next commit.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agobgpd: fix incorrect json output in bgp_show_table_rd()
Louis Scalbert [Wed, 7 Jun 2023 13:15:30 +0000 (15:15 +0200)]
bgpd: fix incorrect json output in bgp_show_table_rd()

'{}' extra output may present JSON output from bgp_show_table_rd() when
no prefix are seen.

> {
>  "vrfId": 0,
>  "vrfName": "default",
>  "tableVersion": 0,
>  "routerId": "1.1.1.1",
>  "defaultLocPrf": 100,
>  "localAS": 65500,
>  "routes": {  "routeDistinguishers" : { "444:1" : {  }  }  }  }
> {}

Do not output '{}' when bgp_show_table() returns a valid JSON.
Tested without rd in config, bgp_show_table() returns nothing and the
JSON output is only '{}'

Fixes: 0224b3296c ("bgpd: Print empty JSON `{}` if no entries under `show bgp ipv4 vpn json`")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agobgpd: cleanup un-imported vpn prefix if no retain set
Louis Scalbert [Wed, 7 Jun 2023 10:46:30 +0000 (12:46 +0200)]
bgpd: cleanup un-imported vpn prefix if no retain set

After some VRF imports are removed and "no bgp retain route-target all"
is set, prefixes that are not imported anymore remain in the BGP table.

Parse the BGP table and remove un-imported prefixes in such a case.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agobgpd: fix memory usage of vpn no retain
Louis Scalbert [Tue, 6 Jun 2023 10:46:21 +0000 (12:46 +0200)]
bgpd: fix memory usage of vpn no retain

By default, bgpd stores all MPLS VPN SAFI prefixes unless the "no bgp
retain route-target all" option is used to store only prefixes that are
imported into local VRFs. The "no retain" option temporarily uses too
much memory, as all prefixes are stored in memory before the deletion of
non-imported prefixes is done.

Filter out non-imported prefixes before they are set into the BGP adj
RIB out.

Fixes: a486300b26 ("bgpd: implement retain route-target all behaviour")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agobgpd: revert no retain backend
Louis Scalbert [Tue, 6 Jun 2023 12:02:42 +0000 (14:02 +0200)]
bgpd: revert no retain backend

Partially revert a486300b26 ("bgpd: implement retain route-target all
behaviour") in order to fix a memory consumption issue in the next
commit.

Fixes: a486300b26 ("bgpd: implement retain route-target all behaviour")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
22 months agobgpd: fix static analysis issue in subgroup_announce_check()
Philippe Guibert [Fri, 2 Jun 2023 08:10:45 +0000 (10:10 +0200)]
bgpd: fix static analysis issue in subgroup_announce_check()

Remove the check about pi->peer value different from null.
Introducing this check introduces a SA warning on the value
of the from value (derived from pi->peer).

Actually, peer is set when bgp_path_info_make() call is
performed; peer is never null.

Fixes: 23bb4a9b5c64 ("bgpd: advertise mpls vpn routes with appropriate label")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: fix accept-own routes received by a route reflector
Philippe Guibert [Thu, 1 Jun 2023 07:48:58 +0000 (09:48 +0200)]
bgpd: fix accept-own routes received by a route reflector

When using the bgp-accept-own community, with the
'attribute-unchanged next-hop' command, the advertised
mpls vpn updates that are reflected by a route reflector
are received, but are not selected.

Once the accept-own community is detected, a new bgp_path
is created, in addition of the original one; then the
next-hop of the NLRI is checked, but fails for two reasons:
- the next-hop tracking returns the real IP reachability
status for prefixes that have the BGP_ROUTE_IMPORTED subtype.
This is what happens with bgp updates with the accept-own
community.
- as the next-hop was unchanged and was the peer IP in the VRF.
Consequently, the new bgp_path is considered inactive in the
default VRF, and is not selected.

The incoming bgp updates with the accept-own community should
not be checked against the next-hop tracking. As the bgp_path
subtype has been changed to BGP_ROUTE_IMPORTED, let us check
the bgp subtype before calling the 'bgp_find_or_add_nexthop()'
function in the 'bgp_update()' call.

Fixes: 46dbf9d0c0b9 bgpd: ("Implement ACCEPT_OWN extended community")
Fixes: 376797711f4d - bgpd: track mpls vpn nexthops
Fixes: e6110f755718 bgpd: ("fix use nexthop tracking for exported vpn paths")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: fix use nexthop tracking for exported vpn paths
Philippe Guibert [Thu, 1 Jun 2023 05:20:06 +0000 (07:20 +0200)]
bgpd: fix use nexthop tracking for exported vpn paths

When exporting redistributed prefixes from a given VRF
to an MPLS VPN network, the paths are always considered
as valid whereas it should not always be the case.

At exportation, a new MPLS VPN path is built in. Then
nexthop tracking is applied to the new path, and the
SAFI_MPLS_VPN parameter is used to tell the NHT code
to just check for the next-hop reachability. The previous
commit was wrongly considering that nexthop tracking was
never applied to mpls vpn networks. Ensure that nexthop
tracking for exported paths behaves as usual.

Fix this by not returning always 1 in the 'bgp_find_or_add_nexthop()'
function if the passed 'pi' parameter is a 'BGP_IMPORTED_ROUTE'
sub-type entry.

Fixes: 74be3f3ea9ec ("bgpd: track mpls vpn nexthops")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agodoc: add 'mpls bgp l3vpn-multi-domain-switching'
Philippe Guibert [Mon, 15 May 2023 07:12:59 +0000 (09:12 +0200)]
doc: add 'mpls bgp l3vpn-multi-domain-switching'

The 'mpls bgp l3vpn-multi-domain-switching' per-interface
command is documented.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agotopotests: mpls vpn routes redistribution, add asbr test
Philippe Guibert [Fri, 21 Apr 2023 10:25:30 +0000 (12:25 +0200)]
topotests: mpls vpn routes redistribution, add asbr test

This setup demonstrates the redistribution and the proper
switching operations in an asbr device.
The setup interconnects an internal AS with an external
connected AS.
- the iBGP AS uses BGP-LU as MPLS transport
- the eBGP peering is directly connected and does use the
'mpls bgp forwarding' configuration to accept exterior
updates.

The setup performs the following tests:
- it checks for end to end connectivity from one interior
host h1 to two external hosts h2, and h3.
- it checks that the proper label values are advertised
by the ASBR to the iBGP peer, and the eBGP peer.
- it checks that the 'show mpls table' has additional
MPLS entries that permit transit mpls traffic to transit
across the ASBR. That behaviour is possible with the
'mpls bgp allocate-label-on-nexthop-change' command.
- it checks that withdraw of routes will remve the MPLS
entries.
- it checks that by unconfiguring the 'next-hop-self' option,
the external routes advertised to the internal maintain the
next-hop.
- it checks that a second prefix advertised by r3 with the
same RD, but different label value is using a new label on r2,
and that this new label value is used.
- it checks that when filtering out prefixes from r1, on r2,
then the MPLS label is deallocated, and the MPLS entry is not
present.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: add 'show bgp mplsvpn-nh-label-bind' command
Louis Scalbert [Tue, 2 May 2023 15:23:58 +0000 (17:23 +0200)]
bgpd: add 'show bgp mplsvpn-nh-label-bind' command

There is no 'show command' to use for troubleshooting
purposes.
Add a new show command to dump the cache entry of the
MPLS VPN nexthop label bind cache table.
> show bgp [vrf NAME] mplsvpn-nh-label-bind [detail]

The below command illustrates its output:
> dut# show bgp mplsvpn-nh-label-bind  detail
> Current BGP mpls-vpn nexthop label bind cache, VRF default
>  192.168.1.3, label 102, local label 18 #paths 3
>   interface r2-eth1
>   Last update: Mon May 22 14:39:42 2023
>   Paths:
>     1/3 172.31.3.0/24 VRF default flags 0x418
>     1/3 172.31.2.0/24 VRF default flags 0x418
>     1/3 172.31.1.0/24 VRF default flags 0x418
>  192.0.2.1, label 101, local label 19 #paths 1
>   interface r2-eth0
>   Last update: Mon May 22 14:39:43 2023
>   Paths:
>     1/3 172.31.0.0/24 VRF default flags 0x418

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: update the mpls entry to handle return traffic
Philippe Guibert [Thu, 11 May 2023 13:42:08 +0000 (15:42 +0200)]
bgpd: update the mpls entry to handle return traffic

When advertising an mpls vpn entry with a new label,
the return traffic is redirected to the local machine,
but the MPLS traffic is dropped.

Add an MPLS entry to handle MPLS packets which have
the new label value. Traffic is swapped to the original
label value from the mpls vpn next-hop entry; then it is
sent to the resolved next-hop of the original next-hop
from the mpls vpn next-hop entry.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: advertise mpls vpn routes with appropriate label
Philippe Guibert [Thu, 11 May 2023 13:26:50 +0000 (15:26 +0200)]
bgpd: advertise mpls vpn routes with appropriate label

The advertised label value from mpls vpn routes is not modified
when the advertised next-hop is modified to next-hop-self.

Actually, the original label value received is redistributed as
is, whereas the new_label value bound in the nexthop label
bind entry should be used.

Only the VPN entries that contain MPLS information, and that
are redistributed between distinct peers, will have a label
value to advertise.
- no SRv6 attribute
- no local prefix
- no exported VPN prefixes from a VRF

If the advertisement to a given peer has the next-hop modified,
then the new label value will be picked up. The considered cases
are peers configured with 'next-hop-self' option, or ebgp peerings
without the 'next-hop-unchanged' option.

Note that the the NLRI format will follow the rfc3107 format, as
multiple label values for MPLS VPN NLRIs are not supported (the
rfc8277 is not supported).
Note also that the case where an outgoing route-map is applied to
the outgoing neighbor is not considered in this commit.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: allocate label bound to received mpls vpn routes
Philippe Guibert [Thu, 11 May 2023 11:56:16 +0000 (13:56 +0200)]
bgpd: allocate label bound to received mpls vpn routes

Current implementation does not offer a new label to bind
to a received VPN route entry to redistribute with that new
label.

This commit allocates a label for VPN entries that have
a valid label, and a reachable next-hop interface that is
configured as follows:

> interface eth0
>  mpls bgp l3vpn-multi-domain-switching
> exit

An mplsvpn next-hop label binding entry is created in an mpls
vpn nexthop label bind hash table of the current BGP instance.
That mpls vpn next-hop label entry is indexed by the (next-hop,
orig_label) values provided by the incoming updates, and shared
with other updates having the same (next-hop, orig_label) values.

A new 'LP_TYPE_BGP_L3VPN_BIND' label value is picked up from the
zebra mpls label pool, and assigned to the new_label attribute.

The 'bgp_path_info' appends a 'bgp_mplsvpn_nh_label_bind' structure
to the 'mplsvpn' union structure. Both structures in the union are not
used at the same, as the paths are either VRF updates to export, or MPLS
VPN updates. Using an union gives a 24 bytes memory gain compared to if
the structures had not been in an union (24 bytes compared to 48 bytes).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: move label allocation code to a specific function
Philippe Guibert [Thu, 25 May 2023 10:40:45 +0000 (12:40 +0200)]
bgpd: move label allocation code to a specific function

The label allocation mechanism is called implicitly for
labeled unicast paths. The check should be explicit, because
the current patch set will extend the mechanism for mpls vpn
paths, and the code should explicitly tell which safi calls
which code.

Fix this implicit call by checking the safi value. Move the
code to a specific function.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: move the label per nexthop structs of bgp_path to an union
Philippe Guibert [Wed, 24 May 2023 15:26:13 +0000 (17:26 +0200)]
bgpd: move the label per nexthop structs of bgp_path to an union

The label per nexthop attributes take 24 bytes per bgp path
entry on AMD64 platform, and are only used for unicast paths.
The current patch-set introduces a similar attributes, but that
will be used only for l3vpn paths. To gain some memory on the
bgp_path_info structure in the next commit, do some changes.

Create an 'mplsvpn' union structure that will either include the
label per nexthop structs for ipv4 paths, or the l3vpn paths
structures. The 'label_nexthop_cache' and the 'label_nh_thread'
attributes of the 'bgp_path_info' structure are moved into an
union under a new structure called 'bgp_mplsvpn_label_nh_blnc'.
The flags attribute of 'bgp_path_info' is increased from 16 bits
to 32 bits, and the BGP_PATH_MPLSVPN_LABEL_NH flag is added to
know the 'mplsvpn' usage.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: add mpls vpn nh label bind cache struct and apis
Louis Scalbert [Tue, 2 May 2023 14:38:53 +0000 (16:38 +0200)]
bgpd: add mpls vpn nh label bind cache struct and apis

In the context of the ASBR facing an EBGP neighbor, or
facing an IBGP neighbor where the BGP updates received
are re-advertised with a modified next-hop, a new local
label will be re-advertised too, to replace the original
one.

Create a binding table, in the form of a hash list, from the
original labels to the new labels. Since labels can be the
same on several routers, set the next-hop and the label as
the keys. Add the needed API functions to manage the hash
list.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: add LP_TYPE_BGP_L3VPN_BIND label type
Louis Scalbert [Tue, 2 May 2023 14:30:20 +0000 (16:30 +0200)]
bgpd: add LP_TYPE_BGP_L3VPN_BIND label type

Redistributing mpls vpn prefixes with a new label
requires picking up unused MPLS local labels.

Today, there is an MPLS label pool which is owned
by the zebra daemon. BGP gets a chunk of labels
that are shared with the multiple usage of the BGP
daemon. A label type attribute is used whenever
BGP needs a new label value.

The 'LP_TYPE_BGP_L3VPN_BIND' label type will be used
to allocate the MPLS labels that will be bound to
the original next-hop, and label value of an L3VPN
update.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: track mpls vpn nexthops
Philippe Guibert [Fri, 21 Apr 2023 12:28:28 +0000 (14:28 +0200)]
bgpd: track mpls vpn nexthops

There is no nexthop reachability information for
received MPLS VPN prefixes.
This information is necessary when BGP also acts
as LSR device, and is needed to create an MPLS entry
between two BGP speakers: the next-hop to pick-up
in the MPLS entry has to be connected.

The nexthop reachability information is available
for other non MPLS VPN prefixes, and is handled
by the bgp nexthop cache (bnc) contexts.
Extend the usage of the BNC contexts for L3VPN
prefixes.

Note that the MPLS VPN routes had to be redistributed
as before, to avoid breaking existing deployments
that use FRR as route reflectors. Because of this, the
nexthop reachability status has been maintained to OK
for MPLS VPN prefixes.

Note also that the label allocation per nexthop tracking
was wrongly using the MPLS VPN safi to get a valid BNC
context, when choosing which label to return in the
'vpn_leak_from_vrf_get_per_nexthop_label()' function.
Fix this by using SAFI_UNICAST instead.

Fixes: 577be36a41be ("bgpd: add support for l3vpn per-nexthop label")
Link: https://github.com/FRRouting/frr/pull/13380
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: fix label allocation per next-hop applied to unicast
Philippe Guibert [Wed, 24 May 2023 11:50:37 +0000 (13:50 +0200)]
bgpd: fix label allocation per next-hop applied to unicast

The label allocation per next-hop functionality is calling
the 'bgp_find_or_add_nexthop()' method using the SAFI_MPLS_VPN
safi parameter, whereas the call is supposed to apply to
unicast paths.

Fix this by using the SAFI_UNICAST safi parameter in the call.
Simplify the vpn_leak_from_vrf_get_per_nexthop_label() API by
removing the safi parameter from the function.

Fixes: 577be36a41be ("bgpd: add support for l3vpn per-nexthop label")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: add 'mpls bgp l3vpn-multi-domain-switching' command
Louis Scalbert [Tue, 2 May 2023 14:19:20 +0000 (16:19 +0200)]
bgpd: add 'mpls bgp l3vpn-multi-domain-switching' command

When acting as intermediate device for BGP signaling, and
as transit device for data traffic, the device is not able
to modify the label value from incoming MPLS VPN updates:

- as BGP device, modifying the label value is necessary
when redistributing VPN prefixes with its own next-hop.
- as transit device that connects two ethernet segments
on separate interfaces, the return MPLS traffic must be
handled: the modified label value must be swapped with
the original label value and sent back to the original
next-hop.

The border router use case can be taken as example, when
it acts both as transit and as BGP device:
- When receiving updates from a border router peer, and where
interior traffic is expected to transit through the local
border router.
- When receiving updates from interior devices, and where
exterior traffic will transit through the local border router.

In those two situations, a new label is bound to the received
entry, and the entry is advertised to a new peer with the new
label. In the same time, an MPLS entry is created to handle
return traffic with the new mpls label: the traffic would be
swapped to the original MPLS label and the original next-hop.

This is the first commit of a series of patches, that address
the above mentioned issue.
The first commit introduces a new per-interface command:

> interface eth0
>  [no] mpls bgp l3vpn-multi-domain-switching
> exit

This command will authorise mpls vpn updates to have a new
label value bound to the mpls vpn routes received over that
interface.

Link: https://www.rfc-editor.org/rfc/rfc3107.html#section-3
> When a BGP speaker redistributes a route, the label(s) assigned to
> that route must not be changed (except by omission), unless the
> speaker changes the value of the Next Hop attribute of the route.

Link: https://www.rfc-editor.org/rfc/rfc3031.html#section-4.6
Link: https://www.rfc-editor.org/rfc/rfc4364.html#section-10
sub-chapter b.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: add a function to compare two label lists
Philippe Guibert [Thu, 20 Apr 2023 11:10:15 +0000 (13:10 +0200)]
bgpd: add a function to compare two label lists

Create a bgp_labels_same() function that does the
same operations as the static function labels_same from
bgp_mplsvpn.c.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agoRevert "ripngd: Cleanup memory allocations on shutdown"
Igor Ryzhov [Thu, 15 Jun 2023 14:42:05 +0000 (17:42 +0300)]
Revert "ripngd: Cleanup memory allocations on shutdown"

This reverts commit b1d29673ca16e558aea5d632da181555c83980cf.

This commit introduced a crash. When the VRF is deleted, the RIPNG
instance should not be freed, because the NB infrastructure still stores
the pointer to it. The instance should be deleted only when it's actually
deleted from the configuration.

To reproduce the crash:
```
frr# conf t
frr(config)# vrf vrf1
frr(config-vrf)# exit
frr(config)# router ripng vrf vrf1
frr(config-router)# exit
frr(config)# no vrf vrf1
frr(config)# no router ripng vrf vrf1
vtysh: error reading from ripngd: Resource temporarily unavailable (11)Warning: closing connection to ripngd because of an I/O error!
frr(config)#
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
22 months agoRevert "ripd: Cleanup memory allocations on shutdown"
Igor Ryzhov [Thu, 15 Jun 2023 14:35:30 +0000 (17:35 +0300)]
Revert "ripd: Cleanup memory allocations on shutdown"

This reverts commit 3d1588d8ed537e3dbf120e1b2a5ad5b3c00c7897.

This commit introduced a crash. When the VRF is deleted, the RIP instance
should not be freed, because the NB infrastructure still stores the
pointer to it. The instance should be deleted only when it's actually
deleted from the configuration.

To reproduce the crash:
```
frr# conf t
frr(config)# vrf vrf1
frr(config-vrf)# exit
frr(config)# router rip vrf vrf1
frr(config-router)# exit
frr(config)# no vrf vrf1
frr(config)# no router rip vrf vrf1
vtysh: error reading from ripd: Resource temporarily unavailable (11)Warning: closing connection to ripd because of an I/O error!
frr(config)#
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
22 months agobgpd: some safi's do not mix with bgp suppress-fib
Donald Sharp [Wed, 14 Jun 2023 16:25:18 +0000 (12:25 -0400)]
bgpd: some safi's do not mix with bgp suppress-fib

BGP cannot decide to disseminate the safi based upon the
bgp suppress-fib command.  Modify the code to look at
the safi for the decision to communicate to a peer the
particular node.

Ticket: #3402926
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoMerge pull request #13742 from sri-mohan1/srib-ldpd1
Mark Stapp [Wed, 14 Jun 2023 15:14:16 +0000 (11:14 -0400)]
Merge pull request #13742 from sri-mohan1/srib-ldpd1

ldpd: changes for code maintainability

22 months agodoc: Fix one syntax error for code block
anlan_cs [Wed, 14 Jun 2023 12:56:25 +0000 (20:56 +0800)]
doc: Fix one syntax error for code block

The code block doesn't work because blank line is missing.
So, just make it work.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
22 months agoldpd: changes for code maintainability
sri-mohan1 [Thu, 8 Jun 2023 17:49:43 +0000 (23:19 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
22 months agoMerge pull request #13793 from LabNConsulting/aceelindem/coverity-doc-update
Donald Sharp [Wed, 14 Jun 2023 10:57:57 +0000 (06:57 -0400)]
Merge pull request #13793 from LabNConsulting/aceelindem/coverity-doc-update

doc: Update Coverity workflow in developer documentation.

22 months agoMerge pull request #13783 from opensourcerouting/fix/some_gcc13_nits
Donald Sharp [Wed, 14 Jun 2023 10:56:40 +0000 (06:56 -0400)]
Merge pull request #13783 from opensourcerouting/fix/some_gcc13_nits

GCC13 nits

22 months agoisisd: Fix use beyond end of stream of ASLA Sub-TLV parsing
Carmine Scarpitta [Sat, 10 Jun 2023 14:08:25 +0000 (16:08 +0200)]
isisd: Fix use beyond end of stream of ASLA Sub-TLV parsing

Fixes a crash associated with attempting to read beyond the end of the
stream when parsing ASLA Sub-TLV.

```
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
    subtlv_len=13 '\r') at isisd/isis_tlvs.c:1473
    at isisd/isis_tlvs.c:3264
    context=<optimized out>, mtid=<optimized out>) at isisd/isis_tlvs.c:6078
    indent=4) at isisd/isis_tlvs.c:6142
    avail_len=<optimized out>, context=<optimized out>) at isisd/isis_tlvs.c:7032
    at isisd/isis_tlvs.c:7054
(gdb)
```

Caught by fuzzer.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
22 months agodoc: Update Coverity workflow in developer documentation.
Acee Lindem [Tue, 13 Jun 2023 20:10:48 +0000 (16:10 -0400)]
doc: Update Coverity workflow in developer documentation.

Signed-off-by: Acee Lindem <aceelindem@gmail.com>
22 months agoMerge pull request #13766 from LabNConsulting/chopps/mgmtd-cleanup
Igor Ryzhov [Tue, 13 Jun 2023 19:50:39 +0000 (22:50 +0300)]
Merge pull request #13766 from LabNConsulting/chopps/mgmtd-cleanup

mgmtd cleanup/simplify some code

22 months agoMerge pull request #13768 from LabNConsulting/chopps/mgmt-better-logs
Igor Ryzhov [Tue, 13 Jun 2023 19:43:11 +0000 (22:43 +0300)]
Merge pull request #13768 from LabNConsulting/chopps/mgmt-better-logs

mgmtd: improvements in logging and commentary

22 months agoMerge pull request #13764 from LabNConsulting/chopps/robust1
Igor Ryzhov [Tue, 13 Jun 2023 19:25:13 +0000 (22:25 +0300)]
Merge pull request #13764 from LabNConsulting/chopps/robust1

lib: mgmtd: make error handling more robust

22 months agoMerge pull request #13755 from LabNConsulting/ziemba/zebra-dplane-priority
Donald Sharp [Tue, 13 Jun 2023 14:36:57 +0000 (10:36 -0400)]
Merge pull request #13755 from LabNConsulting/ziemba/zebra-dplane-priority

zebra: bugfix dplane priority sorting

22 months agoMerge pull request #13589 from mjstapp/fix_pbr_zebra
Donald Sharp [Tue, 13 Jun 2023 14:23:46 +0000 (10:23 -0400)]
Merge pull request #13589 from mjstapp/fix_pbr_zebra

pbrd, zebra: fix zapi and netlink rule encoding

22 months agoMerge pull request #13612 from chiragshah6/fdev1
Russ White [Tue, 13 Jun 2023 13:55:07 +0000 (09:55 -0400)]
Merge pull request #13612 from chiragshah6/fdev1

ospfd: fix interface param type update

22 months agobgpd: Use enum bgp_create_error_code as argument in header
Donatas Abraitis [Tue, 13 Jun 2023 13:08:24 +0000 (16:08 +0300)]
bgpd: Use enum bgp_create_error_code as argument in header

```
bgpd/bgp_vty.c:865:5: warning: conflicting types for ‘bgp_vty_return’ due to enum/integer mismatch; have ‘int(struct vty *, enum bgp_create_error_code)’ [-Wenum-int-mismatch]
  865 | int bgp_vty_return(struct vty *vty, enum bgp_create_error_code ret)
      |     ^~~~~~~~~~~~~~
In file included from ./bgpd/bgp_mplsvpn.h:15,
                 from bgpd/bgp_vty.c:48:
./bgpd/bgp_vty.h:148:12: note: previous declaration of ‘bgp_vty_return’ with type ‘int(struct vty *, int)’
  148 | extern int bgp_vty_return(struct vty *vty, int ret);
      |            ^~~~~~~~~~~~~~
```

Fixing stuff regarding GCC13.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Use enum bgp_fsm_state_progress for bgp_stop()
Donatas Abraitis [Tue, 13 Jun 2023 13:01:40 +0000 (16:01 +0300)]
bgpd: Use enum bgp_fsm_state_progress for bgp_stop()

```
bgpd/bgp_fsm.c:1360:29: warning: conflicting types for ‘bgp_stop’ due to enum/integer mismatch; have ‘enum bgp_fsm_state_progress(struct peer *)’ [-Wenum-int-mismatch]
 1360 | enum bgp_fsm_state_progress bgp_stop(struct peer *peer)
      |                             ^~~~~~~~
In file included from bgpd/bgp_fsm.c:29:
./bgpd/bgp_fsm.h:111:12: note: previous declaration of ‘bgp_stop’ with type ‘int(struct peer *)’
  111 | extern int bgp_stop(struct peer *peer);
      |            ^~~~~~~~
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agovrrp: check return value for turning off multicast for v6
Loganaden Velvindron [Thu, 8 Jun 2023 10:48:17 +0000 (14:48 +0400)]
vrrp: check return value for turning off multicast for v6

CID1519841: check return value and set error

Signed-off-by: Loganaden Velvindron <logan@cyberstorm.mu>
22 months agoMerge pull request #13775 from mobash-rasool/fixes2
David Lamparter [Tue, 13 Jun 2023 10:50:06 +0000 (12:50 +0200)]
Merge pull request #13775 from mobash-rasool/fixes2

22 months agoMerge pull request #13767 from opensourcerouting/fix/convert_rip_topo1_to_polling
Christian Hopps [Tue, 13 Jun 2023 08:20:49 +0000 (04:20 -0400)]
Merge pull request #13767 from opensourcerouting/fix/convert_rip_topo1_to_polling

tests: Convert rip/ripng tests using run_and_expect

22 months agolib: mgmtd: improvements in logging and commentary
Christian Hopps [Fri, 9 Jun 2023 20:54:54 +0000 (16:54 -0400)]
lib: mgmtd: improvements in logging and commentary

- log names of datastores not numbers
- improve logging for mgmt_msg_read
- Rather than use a bool, instead store the pending const string name of
the command being run that has postponed the CLI. This adds some nice
information to the logging when enabled.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agoMerge pull request #13763 from LabNConsulting/mgmtd/simplify
Donatas Abraitis [Tue, 13 Jun 2023 08:10:18 +0000 (11:10 +0300)]
Merge pull request #13763 from LabNConsulting/mgmtd/simplify

fix 'exit' bug in config file processing, et al.

22 months agopimd,pim6d: Correct the socket to send reg-stop msg
Mobashshera Rasool [Mon, 12 Jun 2023 13:07:22 +0000 (06:07 -0700)]
pimd,pim6d: Correct the socket to send reg-stop msg

We were using the pim interface socket to send the register
stop msg, it works fine in cases where the interface on which
register msg is received and the interface on which the register-stop
msg is supposed to be sent is the same.
But when the interfaces are different, msg send fails because
the outgoing interface is not right.

Fixes: #13774
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
22 months agozebra: clarify interface-level mpls config
Mark Stapp [Wed, 26 Apr 2023 19:55:32 +0000 (15:55 -0400)]
zebra: clarify interface-level mpls config

We have both interface-level configuration to enable mpls,
and runtime mpls status. They need to be distinct.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agopbrd, zebra: fix zapi and netlink rule encoding
Mark Stapp [Tue, 23 May 2023 19:31:31 +0000 (15:31 -0400)]
pbrd, zebra: fix zapi and netlink rule encoding

In pbrd, don't encode a rule without a table. There are cases
where the zapi encoding was incorrect because the 4-octet
table id was missing. In zebra, mask off the ECN bits in the
TOS byte when encoding an iprule to match netlink's
expectation.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agoMerge pull request #13704 from donaldsharp/flowspec_support_bundle
David Lamparter [Mon, 12 Jun 2023 16:47:55 +0000 (18:47 +0200)]
Merge pull request #13704 from donaldsharp/flowspec_support_bundle

22 months agobgpd: Add some color to why nexthop_set failed
Donald Sharp [Wed, 7 Jun 2023 14:09:27 +0000 (10:09 -0400)]
bgpd: Add some color to why nexthop_set failed

We are seeing some frequent test failures with
setting the nexthop correctly.  At this point
in time, I have no idea what is going wrong,
but I don't have a bunch of information either,
so let's add the local and remote values.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agotests: test_bgp_flowspec_topo.py changes as per linter
Donald Sharp [Tue, 6 Jun 2023 18:50:25 +0000 (14:50 -0400)]
tests: test_bgp_flowspec_topo.py changes as per linter

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