]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
4 months agobgpd: fix memory leak when reconfiguring a route distinguisher 17669/head
Philippe Guibert [Wed, 18 Dec 2024 15:53:48 +0000 (16:53 +0100)]
bgpd: fix memory leak when reconfiguring a route distinguisher

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

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

bgpd: remove unneeded printfrr reg for pRN

4 months agoMerge pull request #16488 from JosiahMg/isis-subif-neighbor
Russ White [Tue, 17 Dec 2024 16:39:20 +0000 (11:39 -0500)]
Merge pull request #16488 from JosiahMg/isis-subif-neighbor

vlan-subif isis neigbor

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

bgpd: Fix evpn bestpath calculation when path is not established

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

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

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

zebra: fix wrong nexthop status for kernel routes

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

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

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

bgpd: fix missing addpath withdrawal race condition

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

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

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

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

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

This commit would skip the uninstallation for kernel routes.

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

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

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

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

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

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

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

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

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

Remove a printfrr registration for pRN from bgpd.

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

Fix PIMD RPF lookup mode and nexthop tracking

4 months agoMerge pull request #17645 from donaldsharp/support_bundle_rip
Jafar Al-Gharaibeh [Fri, 13 Dec 2024 20:24:31 +0000 (14:24 -0600)]
Merge pull request #17645 from donaldsharp/support_bundle_rip

tools: Add rip support bundle commands

4 months agoMerge pull request #17646 from donaldsharp/give_more_zserv_data
Jafar Al-Gharaibeh [Fri, 13 Dec 2024 20:23:58 +0000 (14:23 -0600)]
Merge pull request #17646 from donaldsharp/give_more_zserv_data

zebra: Give a bit more data about zclient connection on errors

4 months agodoc: Clean up Multicast RIB documentation 17252/head
Nathan Bahr [Tue, 24 Sep 2024 21:53:41 +0000 (21:53 +0000)]
doc: Clean up Multicast RIB documentation

Moved it all to PIM section and updated docs for recent changes.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agotests: Add new pim mrib tests
Nathan Bahr [Fri, 25 Oct 2024 20:03:07 +0000 (20:03 +0000)]
tests: Add new pim mrib tests

Test mrib overrides and rpf lookup mode changes.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agopimd: Clean up pim RPF/NHT show commands
Nathan Bahr [Wed, 23 Oct 2024 19:00:57 +0000 (19:00 +0000)]
pimd: Clean up pim RPF/NHT show commands

Moved `show ip rpf A.B.C.D` command here from zebra, deprecated and aliased
to `show ip pim nexthop-lookup`.
Allow group to be optional in the lookup command. Only validate group if
source is ANY. Documented setting source via RP if not provided.
Added new output if ANY source + group lookup is performed and no
RP is found for the group. Updated output to include souce and
group for lookup.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agopimd: Update nexthops when lookup mode changes
Nathan Bahr [Fri, 25 Oct 2024 19:10:17 +0000 (19:10 +0000)]
pimd: Update nexthops when lookup mode changes

Link up the RPF lookup mode changing to a force update to RP's and
upstreams registered for nexthop lookup cache updates.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agopimd: Refactor pim NHT
Nathan Bahr [Wed, 23 Oct 2024 19:00:31 +0000 (19:00 +0000)]
pimd: Refactor pim NHT

Refactor the next hop tracking in PIM to fully support the configured RPF lookup mode.
Moved many NHT related functions to pim_nht.h/c
NHT now tracks both MRIB and URIB tables and makes nexthop decisions based on the configured lookup mode.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agopimd: Refactor synchronous nexthop lookup
Nathan Bahr [Wed, 23 Oct 2024 18:48:57 +0000 (18:48 +0000)]
pimd: Refactor synchronous nexthop lookup

Add prefix length in nexthop response.
Apply lookup mode to the sychronous lookups, where we may lookup
the MRIB, URIB, or both and make a decision based on the nexthop.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agopimd,yang: Reimplement RPF lookup vty in router pim
Nathan Bahr [Wed, 2 Oct 2024 19:03:48 +0000 (19:03 +0000)]
pimd,yang: Reimplement RPF lookup vty in router pim

Add rpf-lookup-mode MODE vty command under router pim block.
Including NB piping and config write. Using the mode still pending.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agozebra: Give a bit more data about zclient connection on errors 17646/head
Donald Sharp [Fri, 13 Dec 2024 16:21:26 +0000 (11:21 -0500)]
zebra: Give a bit more data about zclient connection on errors

When debugging a crash I noticed that sometimes we talked about
a zclient connection in relation to the fd associated with it
and sometimes we did not.  Let's just always give the data
associated with the fd.  It will make it a bit easier for me
to follow the transitions.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotools: Add rip support bundle commands 17645/head
Donald Sharp [Fri, 13 Dec 2024 15:56:17 +0000 (10:56 -0500)]
tools: Add rip support bundle commands

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #17642 from opensourcerouting/pim-cs
Jafar Al-Gharaibeh [Fri, 13 Dec 2024 15:37:07 +0000 (09:37 -0600)]
Merge pull request #17642 from opensourcerouting/pim-cs

pimd,pim6d: optimize multicast prefix generation and fix coverity scan defect

4 months agoMerge pull request #17635 from opensourcerouting/pim6-embedded-crash
Jafar Al-Gharaibeh [Fri, 13 Dec 2024 15:36:28 +0000 (09:36 -0600)]
Merge pull request #17635 from opensourcerouting/pim6-embedded-crash

pim6d: fix crash on clear ipv6 mroute

4 months agopimd,pim6d: optimize multicast prefix generation 17642/head
Rafael Zalamena [Fri, 13 Dec 2024 01:44:29 +0000 (22:44 -0300)]
pimd,pim6d: optimize multicast prefix generation

Fix Coverity Scan CID 1602463: make it impossible for the function to fail.

Hardcode the multicast prefix generation instead of calling `str2prefix()`
which caused unnecessary memory allocations and returned error values.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agoMerge pull request #17640 from opensourcerouting/feature/graphviz_frr_releases
Jafar Al-Gharaibeh [Fri, 13 Dec 2024 04:02:44 +0000 (22:02 -0600)]
Merge pull request #17640 from opensourcerouting/feature/graphviz_frr_releases

doc: Update the next release dates

4 months agoMerge pull request #17641 from donaldsharp/bgp_path_info_no_infinite_loop
Jafar Al-Gharaibeh [Fri, 13 Dec 2024 04:02:28 +0000 (22:02 -0600)]
Merge pull request #17641 from donaldsharp/bgp_path_info_no_infinite_loop

bgpd: When calling bgp_process, prevent infinite loop

4 months agobgpd: When calling bgp_process, prevent infinite loop 17641/head
Donald Sharp [Thu, 12 Dec 2024 20:08:35 +0000 (15:08 -0500)]
bgpd: When calling bgp_process, prevent infinite loop

If we have this construct:

for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) {
     ...
     bgp_process();
}

This can induce an infinite loop.  This happens because bgp_process
will move the unsorted items to the top of the list for handling,
as such it is necessary to hold the next pointer to the side
to actually look at each possible bgp_path_info.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #17622 from opensourcerouting/msdp-originator
Jafar Al-Gharaibeh [Thu, 12 Dec 2024 16:57:06 +0000 (10:57 -0600)]
Merge pull request #17622 from opensourcerouting/msdp-originator

pimd: MSDP originador ID configuration

4 months agodoc: Update the next release dates 17640/head
Donatas Abraitis [Thu, 12 Dec 2024 16:09:45 +0000 (18:09 +0200)]
doc: Update the next release dates

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agotest: Fix tests for zebra changes
Nathan Bahr [Tue, 24 Sep 2024 22:10:41 +0000 (22:10 +0000)]
test: Fix tests for zebra changes

Remove use of `ip multicast rpf-lookup-mode` from unrelated tests.
Looks like this test was just unlucky enough to pick that command as an
example for use here. Just changed it to something less likely to be
removed in the future.
Update route table output to include AFI SAFI output.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agozebra: Improve multicast safi route show commands
Nathan Bahr [Tue, 29 Oct 2024 19:30:00 +0000 (19:30 +0000)]
zebra: Improve multicast safi route show commands

Add `mrib` flag to existing "show ip route" commands which then use
the multicast safi rather than the unicast safi. Updated the vty output
to include the AFI and SAFI string when printing the table.
Deprecate `show ip rpf` command, aliased to `show ip route mrib`.
Removed `show ip rpf A.B.C.D`.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agozebra,yang: Completely remove multicast mode from zebra
Nathan Bahr [Tue, 24 Sep 2024 20:13:35 +0000 (20:13 +0000)]
zebra,yang: Completely remove multicast mode from zebra

Multicast mode belongs in PIM, so removing it completely from zebra.
Modified `show (ip|ipv6) rpf ADDRESS` to always lookup from SAFI_MULTICAST.
This means this command is now specific to the multicast table and does
not necessarily reflect the PIM RPF lookup, but that should be implemented
in PIM instead.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agozebra,pimd,lib: Modify ZEBRA_NEXTHOP_LOOKUP_MRIB
Nathan Bahr [Tue, 24 Sep 2024 19:57:46 +0000 (19:57 +0000)]
zebra,pimd,lib: Modify ZEBRA_NEXTHOP_LOOKUP_MRIB

Modified ZEBRA_NEXTHOP_LOOKUP_MRIB to include the SAFI from which to do the lookup.
This generalizes the API away from MRIB specifically and allows the user to decide how it should do lookups.
Rename ZEBRA_NEXTHOP_LOOKUP_MRIB to ZEBRA_NEXTHOP_LOOKUP now that it is more generalized.
This change is in preperation to remove multicast lookup mode completely from zebra.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
4 months agodoc: document new command MSDP originator ID 17622/head
Rafael Zalamena [Tue, 10 Dec 2024 19:49:01 +0000 (16:49 -0300)]
doc: document new command MSDP originator ID

Let user know about new MSDP knob to configure originator ID.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agotopotests: topology to test MSDP originator ID
Rafael Zalamena [Tue, 10 Dec 2024 19:44:08 +0000 (16:44 -0300)]
topotests: topology to test MSDP originator ID

Import new topology to test originator ID configuration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agopimd: support originator id configuration
Rafael Zalamena [Tue, 10 May 2022 11:23:45 +0000 (08:23 -0300)]
pimd: support originator id configuration

Allow user to specify the RP field for the SA messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agoMerge pull request #17636 from opensourcerouting/msdp-cleanup
Donald Sharp [Thu, 12 Dec 2024 13:28:49 +0000 (08:28 -0500)]
Merge pull request #17636 from opensourcerouting/msdp-cleanup

pimd: clean up MSDP code

4 months agoMerge pull request #17638 from donaldsharp/zebra_metaq_stuff
Donatas Abraitis [Thu, 12 Dec 2024 09:10:31 +0000 (11:10 +0200)]
Merge pull request #17638 from donaldsharp/zebra_metaq_stuff

zebra: Remove tests for allocation failure

4 months agoMerge pull request #17637 from opensourcerouting/fix/show_which_prefix_is_suppressed
Donald Sharp [Thu, 12 Dec 2024 00:25:57 +0000 (19:25 -0500)]
Merge pull request #17637 from opensourcerouting/fix/show_which_prefix_is_suppressed

bgpd: Show which prefix is suppressed if debug out is enabled

4 months agobgpd: Fix evpn bestpath calculation when path is not established 17613/head
Donald Sharp [Thu, 5 Dec 2024 18:12:00 +0000 (13:12 -0500)]
bgpd: Fix evpn bestpath calculation when path is not established

If you have a bestpath list that looks something like this:

<local evpn mac route>
<learned from peer out swp60>
<learned from peer out swp57>

And a network event happens that causes the peer out swp60
to not be in an established state, yet we still have the
path_info for the destination for swp60, bestpath
will currently end up with this order:

<learned from peer out swp60>
<local evpn mac route>
<learned from peer out swp57>

This causes the local evpn mac route to be deleted in zebra( Wrong! ).

This is happening because swp60 is skipped in bestpath calculation and
not considered to be a path yet it stays at the front of the list.

Modify bestpath calculation such that when pulling the unsorted_list
together to pull path info's into that list when they are also
not in a established state.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agozebra: Remove tests for allocation failure 17638/head
Donald Sharp [Wed, 11 Dec 2024 16:43:48 +0000 (11:43 -0500)]
zebra: Remove tests for allocation failure

This cannot happen.  No need to test

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #17605 from donaldsharp/upstream_some_evpn
Donatas Abraitis [Wed, 11 Dec 2024 16:15:09 +0000 (18:15 +0200)]
Merge pull request #17605 from donaldsharp/upstream_some_evpn

Upstream some internal code

4 months agobgpd: Show which prefix is suppressed if debug out is enabled 17637/head
Donatas Abraitis [Wed, 11 Dec 2024 16:13:49 +0000 (18:13 +0200)]
bgpd: Show which prefix is suppressed if debug out is enabled

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agopimd: move all MSDP code to its own place 17636/head
Rafael Zalamena [Wed, 11 Dec 2024 14:53:36 +0000 (11:53 -0300)]
pimd: move all MSDP code to its own place

Guard MSDP code to compile only on IPv4 and remove all MSDP code from
PIMv6.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agopimd: move MSDP configuration and initialization
Rafael Zalamena [Wed, 11 Dec 2024 14:49:46 +0000 (11:49 -0300)]
pimd: move MSDP configuration and initialization

Reorganize the MSDP initialization code and configuration writing code
to its appropriated place.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agopim6d: ignore more MSDP callbacks
Rafael Zalamena [Wed, 11 Dec 2024 14:44:40 +0000 (11:44 -0300)]
pim6d: ignore more MSDP callbacks

PIMv6 does not implement MSDP, users should use PIMv6 embedded RP
instead.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agoMerge pull request #17555 from pguibert6WIND/bmp_rd_instance_support
Donatas Abraitis [Wed, 11 Dec 2024 14:06:38 +0000 (16:06 +0200)]
Merge pull request #17555 from pguibert6WIND/bmp_rd_instance_support

BMP Peer Distinguisher support

4 months agopim6d: fix crash on clear ipv6 mroute 17635/head
Rafael Zalamena [Wed, 11 Dec 2024 13:39:36 +0000 (10:39 -0300)]
pim6d: fix crash on clear ipv6 mroute

Fix crash on `clear ipv6 mroute` when using embedded RP.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 months agobgpd: bmp, add peer type and distinguisher support for stat messages 17555/head
Philippe Guibert [Mon, 23 Sep 2024 14:03:13 +0000 (16:03 +0200)]
bgpd: bmp, add peer type and distinguisher support for stat messages

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd, topotests: bmp, fix wrong peer distinguisher value for peer vrf up/down
Philippe Guibert [Thu, 31 Oct 2024 09:19:48 +0000 (10:19 +0100)]
bgpd, topotests: bmp, fix wrong peer distinguisher value for peer vrf up/down

When running the bgp_bmp_2 vrf test, peer vrf up/down events from the pre
and post policy are received with a wrong peer distinguisher value.

> {"peer_type": "route distinguisher instance", "policy": "pre-policy",
> "ipv6": true, "peer_ip": "192:168::2", "peer_distinguisher": "0:0",
> "peer_asn": 65502, "peer_bgp_id": "192.168.0.2", "timestamp":
> "2024-10-16 21:59:53.111962", "bmp_log_type": "peer up", "local_ip":
> "192:168::1", "local_port": 179, "remote_port": 50836, "seq": 5}

RFC7854 mentions in 4.2 that if the peer is a "RD Instance Peer", it is
set to the route distinguisher of the particular instance the peer
belongs to.

Fix this by modifying the BMP client, update the peer distinguisher
value by filling the peer distinguisher in the bmp_peerstate function.

> {"peer_type": "route distinguisher instance", "policy": "pre-policy",
> "ipv6": true, "peer_ip": "192:168::2", "peer_distinguisher": "444:1",
> "peer_asn": 65502, "peer_bgp_id": "192.168.0.2", "timestamp":
> "2024-10-16 21:59:53.111962", "bmp_log_type": "peer up", "local_ip":
> "192:168::1", "local_port": 179, "remote_port": 50836, "seq": 5}

Add a test to check that peer_distinguisher value is not 0:0 when an
RD instance is set.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd, topotests: bmp, fix wrong peer type for peer up/down events
Philippe Guibert [Thu, 31 Oct 2024 08:31:04 +0000 (09:31 +0100)]
bgpd, topotests: bmp, fix wrong peer type for peer up/down events

When running the bgp_bmp_2 vrf test, peer up/down events from the pre
and post policy are received with a wrong peer type value

> {"peer_type": "global instance", "policy": "pre-policy", "ipv6": false,
> "peer_ip": "192.168.0.2", "peer_distinguisher": "0:0", "peer_asn": 65502,
> "peer_bgp_id": "192.168.0.2", "timestamp": "2024-10-16 21:59:53.111962",
> "bmp_log_type": "peer up", "local_ip": "192.168.0.1", "local_port": 179,
> "remote_port": 50710, "seq": 4}

RFC7854 defines RD instance peer type, and later in 4.2 requests that
the peer distinguisher value be set to non zero value when the peer type
is not global. This is the case for peer vrf instances.

Fix this by modifying the BMP client, update the peer type
value by updating the peer type value when sending peer up/down messages.

Add a check in the bgp_bmp_2 test to ensure that peer type is correctly
set.

> {"peer_type": "route distinguisher instance", "policy": "pre-policy",
> "ipv6": true, "peer_ip": "192:168::2", "peer_distinguisher": "0:0",
> "peer_asn": 65502, "peer_bgp_id": "192.168.0.2", "timestamp":
> "2024-10-16 21:59:53.111962", "bmp_log_type": "peer up", "local_ip":
> "192:168::1", "local_port": 179, "remote_port": 50836, "seq": 5}

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events
Philippe Guibert [Thu, 31 Oct 2024 07:21:22 +0000 (08:21 +0100)]
bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events

When running the bgp_bmp_2 vrf test, peer route messages from the pre
and post policy are received with a wrong peer distinguisher value.

> {"peer_type": "route distinguisher instance", "policy": "pre-policy", "ipv6": false,
> "peer_ip": "192.168.0.2", "peer_distinguisher": "0:0", "peer_asn": 65502,
> "peer_bgp_id": "192.168.0.2", "timestamp": "2024-10-31 08:19:58.111963",
> "bmp_log_type": "update", "origin": "IGP", "as_path": "65501 65502",
> "bgp_nexthop": "192.168.0.2", "ip_prefix": "172.31.0.15/32", "seq": 15}

RFC7854 mentions in 4.2 that if the peer is a "RD Instance Peer", it is
set to the route distinguisher of the particular instance the peer
belongs to.

Fix this by modifying the BMP client:
- update the peer distinguisher value by unlocking the filling of the peer distinguisher in the function.
This change impacts monitoring messages.
- add the peer distinguisher computation for mirror messages
- modify the bgp_bmp_2 vrf test, update the peer_distinguisher value

> {"peer_type": "route distinguisher instance", "policy": "pre-policy", "ipv6": false,
> "peer_ip": "192.168.0.2", "peer_distinguisher": "444:1", "peer_asn": 65502,
> "peer_bgp_id": "192.168.0.2", "timestamp": "2024-10-31 08:19:58.111963",
> "bmp_log_type": "update", "origin": "IGP", "as_path": "65501 65502",
> "bgp_nexthop": "192.168.0.2", "ip_prefix": "172.31.0.15/32", "seq": 15}

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd, topotests: bmp, fix wrong peer type for vrf route messages
Philippe Guibert [Thu, 31 Oct 2024 08:18:56 +0000 (09:18 +0100)]
bgpd, topotests: bmp, fix wrong peer type for vrf route messages

When running the bgp_bmp_2 vrf test, peer route messages from the pre
and post policy are received with a wrong peer type value

> {"peer_type": "global instance", "policy": "pre-policy", "ipv6": false,
> "peer_ip": "192.168.0.2", "peer_distinguisher": "0:0", "peer_asn": 65502,
> "peer_bgp_id": "192.168.0.2", "timestamp": "2024-10-31 08:19:58.111963",
> "bmp_log_type": "update", "origin": "IGP", "as_path": "65501 65502",
> "bgp_nexthop": "192.168.0.2", "ip_prefix": "172.31.0.15/32", "seq": 15}

In addition to global instance peers, RFC7854 defines RD instance peers.
This value can be used for peers which are on a BGP VRF instance, for
example with an L3VPN setup.

When configuring a BGP VRF instance, the peer type should be seen as an
RD instance peer.

Fix this by modifying the BMP client:
- update the peer type for vrf mirror and monitoring messages
- modify bgp_bmp_2 vrf test to control the peer_type value

> {"peer_type": "route distinguisher instance", "policy": "pre-policy", "ipv6": false,
> "peer_ip": "192.168.0.2", "peer_distinguisher": "0:0", "peer_asn": 65502,
> "peer_bgp_id": "192.168.0.2", "timestamp": "2024-10-31 08:19:58.111963",
> "bmp_log_type": "update", "origin": "IGP", "as_path": "65501 65502",
> "bgp_nexthop": "192.168.0.2", "ip_prefix": "172.31.0.15/32", "seq": 15}

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd: bmp, add peer distinguisher support for peer up/down
Philippe Guibert [Wed, 30 Oct 2024 20:57:35 +0000 (21:57 +0100)]
bgpd: bmp, add peer distinguisher support for peer up/down

All BMP peer up/down messages send a 0:0 peer distinguisher.
This will not be ok when adding RD instance type.

Add code to get the peer distinguisher value.
- modify the API to pass the BGP instance instead of BMP.
- implement error cases with an unknown vrf identifier or a
peer type with local type value.
- handle the error return of the API; consequently, handle
the bmp_peerstate() error return in the calling functions.

There is no functional change, as the peer type value is
either loc-rib or global, both cases are already handled.

The next commit will handle the RD instance case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd: modify bmp_get_peer_distinguisher to support AFI_UNSPEC
Philippe Guibert [Wed, 30 Oct 2024 21:20:30 +0000 (22:20 +0100)]
bgpd: modify bmp_get_peer_distinguisher to support AFI_UNSPEC

If a given L3VRF instance requests a peer distinguisher
for a peer up/down message, the AFI_UNSPEC afi parameter
will be used; no RD is chosen for this AFI.

Fix this by priorizing the AFI_IP value before the AFI_IP6
value. For instance, a router with both RD set for each
address-family, peer up/down messages will be sent with the
RD set to the one for AFI_IP.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agotopotests: bgp_bmp, expose peer_distinguisher in loc-rib
Philippe Guibert [Wed, 30 Oct 2024 20:30:44 +0000 (21:30 +0100)]
topotests: bgp_bmp, expose peer_distinguisher in loc-rib

The BMP implementation currently only supports global and
loc-rib instance types. When loc-rib is selected, the
peer_distinguisher is set to the route distinguisher of
the L3VRF where the BGP instance is. This functionality has
not been tested until now, because the peer distinguisher
value had been explicitly omitted in the bmp messages.

Expose the peer distinguisher value in all BMP messages
received. This change requires to modify the expected output
for loc-rib when the BGP instance is in a L3VRF.

The handling of peer distinguisher value for RD instances
will follow in the next commits.

Link: https://www.rfc-editor.org/rfc/rfc7854.html#section-4.2
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd, topotests: fix wrong peer type for loc-rib peer events
Philippe Guibert [Wed, 30 Oct 2024 20:24:44 +0000 (21:24 +0100)]
bgpd, topotests: fix wrong peer type for loc-rib peer events

When running the bgp_bmp test, peer_up message from the loc-rib
are received with a wrong peer type.
> {"peer_type": "global instance", "policy": "pre-policy", "ipv6": false, "peer_ip": "0.0.0.0",
> "peer_distinguisher": "0:0", "peer_asn": 0, "peer_bgp_id": "0.0.0.0",
> "timestamp": "2024-10-16 21:59:53.111963", "bmp_log_type": "peer up", "local_ip": "0.0.0.0",
> "local_port": 0, "remote_port": 0, "seq": 1}

RFC9069 mentions in 5.1 that peer address must be set to 0.0.0.0,
and the peer_type value must be set to 3. Today, the value set
is 0 (global instance). This is wrong.

Fix this by modifying the BMP client, update the peer type value to
loc-rib on peer up messages.

Modify the current BMP test, by checking the peer up messages for the
0.0.0.0 IP address (which is the value used for loc-rib).

> {"peer_type": "loc-rib instance", "is_filtered": false, "policy": "loc-rib",
> "peer_distinguisher": "0:0", "peer_asn": 65501, "peer_bgp_id": "192.168.0.1",
> "timestamp": "2024-10-16 21:59:53.111963", "bmp_log_type": "peer up", "local_ip": "0.0.0.0",
> "local_port": 0, "remote_port": 0, "seq": 1}

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agoMerge pull request #17624 from raja-rajasekar/rajasekarr/fix_crash_upd_v6
Donatas Abraitis [Wed, 11 Dec 2024 07:03:59 +0000 (09:03 +0200)]
Merge pull request #17624 from raja-rajasekar/rajasekarr/fix_crash_upd_v6

bgpd: Fix bgp core with a possible Intf delete

4 months agobgpd: Fix bgp core with a possible Intf delete 17624/head
Rajasekar Raja [Tue, 10 Dec 2024 21:45:02 +0000 (13:45 -0800)]
bgpd: Fix bgp core with a possible Intf delete

Although trigger unknown, based on the backtrace in one of the internal
testing, we do see some delete in the Intf where we can have the peer
ifp pointer null and we try to dereference it while trying to install
the route leading to a crash

Skip updating the ifindex in such cases and since the nexthop is not
properly updated, BGP skips sending it to zebra.

BackTrace:
0  0x00007faef05e7ebc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007faef0598fb2 in raise () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007faef09900dc in core_handler (signo=11, siginfo=0x7ffdde8cb4b0, context=<optimized out>) at lib/sigevent.c:274
3  <signal handler called>
4  0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc,
   nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273
5  bgp_zebra_announce_actual (dest=dest@entry=0x5560afcfa950, info=0x5560b21187d0, bgp=0x5560ace04df0) at bgpd/bgp_zebra.c:1521
6  0x00005560aad4bc85 in bgp_handle_route_announcements_to_zebra (e=<optimized out>) at bgpd/bgp_zebra.c:1896
7  0x00007faef09a1c0d in thread_call (thread=thread@entry=0x7ffdde8d7580) at lib/thread.c:2008
8  0x00007faef095a598 in frr_run (master=0x5560ac7e5190) at lib/libfrr.c:1223
9  0x00005560aac65db6 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:557

(gdb) f 4
4  0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc,
    nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273
1273 in bgpd/bgp_zebra.c
(gdb) p pi->peer->ifp
$26 = (struct interface *) 0x0

Ticket :#4203904

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
4 months agoMerge pull request #17521 from opensourcerouting/msdp-sa-limit
Jafar Al-Gharaibeh [Tue, 10 Dec 2024 17:36:50 +0000 (11:36 -0600)]
Merge pull request #17521 from opensourcerouting/msdp-sa-limit

pimd: MSDP per peer SA limit

4 months agoMerge pull request #17575 from opensourcerouting/fix/outgoing_rmap_supressed
Russ White [Tue, 10 Dec 2024 16:32:30 +0000 (11:32 -0500)]
Merge pull request #17575 from opensourcerouting/fix/outgoing_rmap_supressed

bgpd: Show which route-map is used when the prefix is filtered by route-map

4 months agoMerge pull request #17608 from opensourcerouting/fix/vpn_import_routes_allowas-in
Russ White [Tue, 10 Dec 2024 16:24:15 +0000 (11:24 -0500)]
Merge pull request #17608 from opensourcerouting/fix/vpn_import_routes_allowas-in

bgpd: Import allowed routes with self AS if desired

4 months agolib: Take ge/le into consideration when checking the prefix with the prefix-list 17615/head
Donatas Abraitis [Tue, 10 Dec 2024 14:28:26 +0000 (16:28 +0200)]
lib: Take ge/le into consideration when checking the prefix with the prefix-list

Without the fix:

```
show ip prefix-list test_1 10.20.30.96/27 first-match
 <no result>

show ip prefix-list test_2 192.168.1.2/32 first-match
 <no result>
```

With the fix:

```
ip prefix-list test_1 seq 10 permit 10.20.30.64/26 le 27
!
end
donatas# show ip prefix-list test_1 10.20.30.96/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 1, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 2, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/28
donatas# show ip prefix-list test_1 10.20.30.126/26
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 3, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.126/30
donatas#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: copy asn of src vrf to evpn type5 route 17605/head
Chirag Shah [Wed, 26 Jan 2022 23:48:44 +0000 (15:48 -0800)]
bgpd: copy asn of src vrf to evpn type5 route

When a unicast route from source vrf is imported into
evpn as type5 route, prepend the asn of the source vrf into
type5 asn path list.

The condition of evpn type5 prefix path info is present but
source vrf route has been cleared via clear command. In this
case existing path info needs to rewrite the source vrf asn.

prepends asn of the source vrf, but the further condition
for existing path attribute for the same route needs to prepend
source vrf asn.

Ticket: #2943080
Testing:
Before fix:
r4# clear ip bgp vrf overlay prefix 0.0.0.0/0
Route Distinguisher: 128.117.243.209:4
*> [5]:[0]:[0]:[0.0.0.0]
         203.0.113.1          0          0 194 ? <--- 64512 is missing
         ET:8 RT:64532:104001 Rmac:06:ec:bf:59:e8:93

After fix:
r4# clear ip bgp vrf overlay prefix 0.0.0.0/0

Route's source vrf bgp output containing ASN 64512:
r4# show bgp vrf overlay
BGP table version is 2, local router ID is 128.117.243.209, vrf id 10
Default local pref 100, local AS 64512
...

Notice after clear command source vrf asn 64512 is retained.
Route Distinguisher: 128.117.243.209:4
*> [5]:[0]:[0]:[0.0.0.0]
         203.0.113.1          0          0 64512 194 ?
         ET:8 RT:64532:104001 Rmac:06:ec:bf:59:e8:93

Signed-off-by: Chirag Shah <chirag@nvidia.com>
4 months agobgpd: only import specific route-types into EVIs
Trey Aspelund [Fri, 5 Nov 2021 15:47:57 +0000 (11:47 -0400)]
bgpd: only import specific route-types into EVIs

Prior to this we were only filtering EVPN routes from the import logic
if they were not route-type 1/2/3/5, which allowed things like RT-5s to
be imported into an L2VNI/MAC-VRF. This adds additional logic to ensure
routes are only imported into EVIs where they make sense.
No more nonsensical route importing!

Ticket: 2848204
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
4 months agozebra: Fix another ships in the night issue with WFI
Donald Sharp [Mon, 18 Oct 2021 17:49:35 +0000 (13:49 -0400)]
zebra: Fix another ships in the night issue with WFI

Effectively When bgp would send a route update down
to zebra and immediately after that a asic update
from the kernel was read.  Zebra would choose the
asic update and drop the bgp update leaving us in
a state where bgp was not used as the true source.

Modify the code so that in rib_multipath_nhe
we notice that we have an unprocessed route update
from bgp.  And if so just drop this kernel update
about an older version of the route since it is
no longer needed.

Ticket: 2722533
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agowatchfrr: increase restart timer 20s -> 90s
Quentin Young [Wed, 11 Aug 2021 18:11:02 +0000 (14:11 -0400)]
watchfrr: increase restart timer 20s -> 90s

This commit:
"tools: run `vtysh -b` once for all-startup"

changed things so that `vtysh -b` is run after all daemons have started
up instead of doing it for each daemon as they are started up. This
results in one long `vtysh -b`, which for large configs and many daemons
(in the case I saw, 4 daemons and 30,000 line config) can exceed the 20
second timer watchfrr uses to kill "hung" background tasks.

Shouldn't be any harm to increasing this to 90 seconds to give us some
leeway while still making sure we kill anything truly misbehaving.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 months agopbrd: fix vrf_unchanged which may depend on other seqs
Wesley Coakley [Thu, 29 Jul 2021 01:37:44 +0000 (21:37 -0400)]
pbrd: fix vrf_unchanged which may depend on other seqs

Ticket: 2740911
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
4 months agopimd: skip init of mlag roles based on the zebra capabilities message
Anuradha Karuppiah [Fri, 18 Jun 2021 15:38:54 +0000 (08:38 -0700)]
pimd: skip init of mlag roles based on the zebra capabilities message

Looks like the cap setting was added for testing mlag via zebra test cli
to config the mlag role. However it is interfering with the valid state
updates rxed from the MLAG daemon based on timing (in some cases the
MLAG state changes are rxed before the capabilities).

Reference logs -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@TORC11:mgmt:/home/cumulus# grep -ri "my_role\|MlagRole" /var/log/frr/bgpd.log
2021/06/18 13:26:40.380130 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: SECONDARY, peer_state: DOWN
2021/06/18 13:26:40.380766 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: SECONDARY, peer_state: DOWN
2021/06/18 13:26:41.382258 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: SECONDARY, peer_state: RUNNING
2021/06/18 13:26:41.382379 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: PRIMARY, peer_state: RUNNING
2021/06/18 13:26:52.386071 ZEBRA: Sending capabilities to client pim: MPLS enabled numMultipath 128 GR disabled MaintMode off MlagRole 0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Ticket: #2691629

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
4 months agozebra: Reduce memory usage of streams for encoding packets
Donald Sharp [Thu, 10 Jun 2021 14:54:11 +0000 (10:54 -0400)]
zebra: Reduce memory usage of streams for encoding packets

For those packets that we are not sending 16k of data, but something
far less than 256 bytes.  Reduce those stream sizes we allocate
to something much more reasonable.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agobgpd: Check L3VNI status before announcing default
vivek [Wed, 9 Jun 2021 20:56:22 +0000 (13:56 -0700)]
bgpd: Check L3VNI status before announcing default

Check that the L3VNI is "up" before taking action to announce or
withdraw the EVPN type-5 default based on configuration. Otherwise,
there can be timing conditions where a EVPN type-5 default route
gets announced without a VNI and with invalid route targets.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Ticket: #2684144
Reviewed By: Chirag Shah
Testing Done:
1. Rerun failed test multiple times successfully
2. Some manual testing
3. precommit and partial evpn-smoke

4 months agozebra: Reset MAC's remote sequence number appropriately
vivek [Wed, 10 Jun 2020 05:15:33 +0000 (22:15 -0700)]
zebra: Reset MAC's remote sequence number appropriately

When a MAC gets deleted but associated neighbors remain, the MAC is
kept in the zebra MAC database as an internal ("auto") entry. When
this happens, reset the MAC's remote sequence number. This ensures that
when the host with the MAC later comes up behind a remote VTEP, the
local switch accepts the MAC and installs it into the bridge FDB and
we don't end up in a situation where remote MACs are not installed
into the bridge FDB.

This fix is a corollary of CM-22753 and is this time done for local
MACs upon delete.

Note: Commit is marked Cumulus-only because I need to evalute more
comprehensive changes before upstreaming it.

Ticket: CM-29581
Reviewed By: As above
Testing Done:
1. Multiple rounds of manual testing
2. Two rounds of evpn-smoke, 1 round of precommit

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Acked-by: Chirag Shah <chirag@cumulusnetworks.com>
Acked-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
4 months agobgpd: Suppress redundant L3VNI delete processing 17526/head
Rajasekar Raja [Tue, 26 Nov 2024 20:02:53 +0000 (12:02 -0800)]
bgpd: Suppress redundant L3VNI delete processing

Consider a master bridge interface (br_l3vni) having a slave vxlan99
mapped to vlans used by 3 L3VNIs.

During ifdown br_l3vni interface, the function
zebra_vxlan_process_l3vni_oper_down() where zebra sends ZAPI to bgp for
a delete L3VNI is sent twice.
 1) if_down -> zebra_vxlan_svi_down()
 2) VXLAN is unlinked from the bridge i.e. vxlan99
    zebra_if_dplane_ifp_handling() --> zebra_vxlan_if_update_vni()
    (since ZEBRA_VXLIF_MASTER_CHANGE flag is set)

During ifup br_l3vni interface, the function
zebra_vxlan_process_l3vni_oper_down() is invoked because of access-vlan
change - process oper down, associate with new svi_if and then process
oper up again

The problem here is that the redundant ZAPI message of L3VNI delete
results in BGP doing a inline Global table walk for remote route
installation when the L3VNI is already removed/deleted. Bigger the
scale, more wastage is the CPU utilization.

Given the triggers for bridge flap is not a common scenario, idea is to
simply return from BGP if the L3VNI is already set to 0 i.e.
if the L3VNI is already deleted, do nothing and return.

NOTE/TBD: An ideal fix is to make zebra not send the second L3VNI delete
ZAPI message. However it is a much involved and a day-1 code to handle
corner cases.

Ticket :#3864372

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
4 months agobgpd: backpressure - Optimize EVPN L3VNI remote routes processing
Rajasekar Raja [Wed, 27 Nov 2024 08:04:51 +0000 (00:04 -0800)]
bgpd: backpressure - Optimize EVPN L3VNI remote routes processing

Anytime BGP gets a L3 VNI ADD/DEL from zebra,
 - Walking the entire global routing table per L3VNI is very expensive.
 - The next read (say of another VNI ADD/DEL) from the socket does
   not proceed unless this walk is complete.

So for triggers where a bulk of L3VNI's are flapped, this results in
huge output buffer FIFO growth spiking up the memory in zebra since bgp
is slow/busy processing the first message.

To avoid this, idea is to hookup the BGP-VRF off the struct bgp_master
and maintain a struct bgp FIFO list which is processed later on, where
we walk a chunk of BGP-VRFs and do the remote route install/uninstall.

Ticket :#3864372

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
4 months agobgpd: backpressure - Optimize EVPN L2VNI remote routes processing
Rajasekar Raja [Wed, 28 Aug 2024 18:38:53 +0000 (11:38 -0700)]
bgpd: backpressure - Optimize EVPN L2VNI remote routes processing

Anytime BGP gets a L2 VNI ADD from zebra,
 - Walking the entire global routing table per L2VNI is very expensive.
 - The next read (say of another VNI ADD) from the socket does
   not proceed unless this walk is complete.

So for triggers where a bulk of L2VNI's are flapped, this results in
huge output buffer FIFO growth spiking up the memory in zebra since bgp
is slow/busy processing the first message.

To avoid this, idea is to hookup the VPN off the bgp_master struct and
maintain a VPN FIFO list which is processed later on, where we walk a
chunk of VPNs and do the remote route install.

Note: So far in the L3 backpressure cases(#15524), we have considered
the fact that zebra is slow, and the buffer grows in the BGP.

However this is the reverse i.e. BGP is very busy processing the first
ZAPI message from zebra due to which the buffer grows huge in zebra
and memory spikes up.

Ticket :#3864372

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
4 months agobgpd: add EVPN route type msg list
Trey Aspelund [Wed, 25 Jan 2023 18:47:24 +0000 (13:47 -0500)]
bgpd: add EVPN route type msg list

Adds a msg list for getting strings mapping to enum bgp_evpn_route_type

Ticket: #3318830

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
4 months agoMerge pull request #17461 from csiltala/multicast-boundary-acl
Donald Sharp [Mon, 9 Dec 2024 15:42:04 +0000 (10:42 -0500)]
Merge pull request #17461 from csiltala/multicast-boundary-acl

pimd: Extend multicast boundary/ACL functionality

4 months agobgpd: Print the actual prefix when we try to import in vpn_leak_to_vrf_update 17608/head
Donatas Abraitis [Sun, 8 Dec 2024 19:48:14 +0000 (21:48 +0200)]
bgpd: Print the actual prefix when we try to import in vpn_leak_to_vrf_update

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: Import allowed routes with self AS if desired
Donatas Abraitis [Sun, 8 Dec 2024 19:46:59 +0000 (21:46 +0200)]
bgpd: Import allowed routes with self AS if desired

Previously we couldn't install VPN routes with self AS in the path because
we never checked if we have allowas-in enabled, or not.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agotests: Check if vpn routes can be imported if allowas-in is set
Donatas Abraitis [Sun, 8 Dec 2024 19:44:52 +0000 (21:44 +0200)]
tests: Check if vpn routes can be imported if allowas-in is set

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17589 from anlancs/master_up
Donatas Abraitis [Sat, 7 Dec 2024 20:35:12 +0000 (22:35 +0200)]
Merge pull request #17589 from anlancs/master_up

zebra: use macro for one check

4 months agoMerge pull request #17538 from idryzhov/netns-doc
Donatas Abraitis [Sat, 7 Dec 2024 20:32:00 +0000 (22:32 +0200)]
Merge pull request #17538 from idryzhov/netns-doc

doc: remove no-op "netns NAMESPACE" command from the docs

4 months agozebra: add deprecation notice for no-op netns command 17538/head
Igor Ryzhov [Sat, 7 Dec 2024 15:01:43 +0000 (17:01 +0200)]
zebra: add deprecation notice for no-op netns command

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
4 months agodoc: remove no-op "netns NAMESPACE" command from the docs
Igor Ryzhov [Sat, 30 Nov 2024 15:16:37 +0000 (17:16 +0200)]
doc: remove no-op "netns NAMESPACE" command from the docs

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
4 months agopimd: Convert boundary_oil_plist to struct prefix_list 17461/head
Corey Siltala [Tue, 26 Nov 2024 14:35:42 +0000 (08:35 -0600)]
pimd: Convert boundary_oil_plist to struct prefix_list

Rather than storing the prefix-list name and looking it up every time we use it, store a pointer to the prefix-list itself.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agodoc: Expand ACL and multicast boundary documentation
Corey Siltala [Thu, 14 Nov 2024 19:08:52 +0000 (13:08 -0600)]
doc: Expand ACL and multicast boundary documentation

Add documentation for existing extended access-list functionality and
the new "ip multicast boundary" command leveraging that functionality.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agotests: Add basic multicast boundary test
Corey Siltala [Thu, 14 Nov 2024 19:08:28 +0000 (13:08 -0600)]
tests: Add basic multicast boundary test

Add simple test to show filtering of IGMP joins using new "ip multicast
boundary" filtering with access-lists, include test of existing prefix-
list based "ip multicast boundary oil" command.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agopimd,yang: Extend multicast boundary functionality
Corey Siltala [Mon, 25 Nov 2024 16:36:54 +0000 (10:36 -0600)]
pimd,yang: Extend multicast boundary functionality

Add new interface command ip multicast boundary ACCESSLIST4_NAME. This
allows filtering on both source and group using the extended access-list
syntax vs. group-only as with the existing "ip multicast boundary oil"
command, which uses prefix-lists. If both are configured, the prefix-
list is evaluated first. The default behavior for both prefix-lists and
access-lists remains "deny", so the prefix-list must have a terminating
"permit" statement in order to also evaluate against the access-list.

The following example denies groups in range 229.1.1.0/24 and groups in
range 232.1.1.0/24 with source 10.0.20.2:

!
ip prefix-list pim-oil-plist seq 10 deny 229.1.1.0/24
ip prefix-list pim-oil-plist seq 20 permit any
!
access-list pim-acl seq 10 deny ip host 10.0.20.2 232.1.1.0 0.0.0.255
access-list pim-acl seq 20 permit ip any any
!
interface r1-eth0
 ip address 10.0.20.1/24
 ip igmp
 ip pim
 ip multicast boundary oil pim-oil-plist
 ip multicast boundary pim-acl
!

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agopimd: Move ACL handling to pim_util.c
Corey Siltala [Mon, 25 Nov 2024 16:43:30 +0000 (10:43 -0600)]
pimd: Move ACL handling to pim_util.c

Move the extended access-list handling from pim_msdp_packet.c to
pim_util.c to allow use elsewhere in the daemon.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agoMerge pull request #17603 from opensourcerouting/fix/bgp_peer_with_peer-group
Jafar Al-Gharaibeh [Fri, 6 Dec 2024 14:55:56 +0000 (08:55 -0600)]
Merge pull request #17603 from opensourcerouting/fix/bgp_peer_with_peer-group

bgpd: Check if as_type is not specified when peer is a peer-group member

4 months agoMerge pull request #17545 from pguibert6WIND/peerup_loc_rib_wrong_format
Donatas Abraitis [Fri, 6 Dec 2024 12:47:48 +0000 (14:47 +0200)]
Merge pull request #17545 from pguibert6WIND/peerup_loc_rib_wrong_format

bgpd: fix peer up message for loc-rib not sent

4 months agoMerge pull request #17579 from donaldsharp/timer_connect_bgp_vrf_netns
Donatas Abraitis [Fri, 6 Dec 2024 12:26:33 +0000 (14:26 +0200)]
Merge pull request #17579 from donaldsharp/timer_connect_bgp_vrf_netns

Timer connect bgp vrf netns

4 months agobgpd: Check if as_type is not specified when peer is a peer-group member 17603/head
Donatas Abraitis [Fri, 6 Dec 2024 06:25:09 +0000 (08:25 +0200)]
bgpd: Check if as_type is not specified when peer is a peer-group member

Fixes this sequences:

```
neighbor pg4 peer-group
neighbor 127.0.0.4 peer-group pg4
neighbor 127.0.0.4 remote-as 65004

neighbor pg5 peer-group
neighbor 127.0.0.5 peer-group pg5
neighbor 127.0.0.5 remote-as internal
```

Fixes: 0dfe256 ("bgpd: Implement neighbor X remote-as auto")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17600 from donaldsharp/bfd_shared_network
Jafar Al-Gharaibeh [Fri, 6 Dec 2024 04:13:39 +0000 (22:13 -0600)]
Merge pull request #17600 from donaldsharp/bfd_shared_network

Bfd shared network

4 months agotests: Fix invalid escape seq seen in bgp_nexthop_ipv6 17579/head
Donald Sharp [Wed, 4 Dec 2024 17:25:11 +0000 (12:25 -0500)]
tests: Fix invalid escape seq seen in bgp_nexthop_ipv6

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: Convert to using `neighbor X timers connect 1` for exabgp using tests
Donald Sharp [Wed, 4 Dec 2024 17:22:59 +0000 (12:22 -0500)]
tests: Convert to using `neighbor X timers connect 1` for exabgp using tests

For those tests using exabgp convert them all to use `neighbor X timers
connect 1`.  I have noticed that occassionally when looking at the
support files for tests run that peers are in a wait period for
reconnecting which is longer than the test is waiting to converge.

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