Commit Graph

7656 Commits

Author SHA1 Message Date
Donatas Abraitis
65c3b1e4c8
Merge pull request #15669 from poojarathore30/listen-limit-logging
bgpd : Ensure logging for dynamic neighbor listen limit reached
2024-04-30 14:54:19 +03:00
Donald Sharp
65c2593a12
Merge pull request #15619 from opensourcerouting/fix/memory_optimizations
bgpd: Put BGP_DEBUG/CONF_BGP_DEBUG under ulikely() optimization
2024-04-29 09:26:03 -04:00
rathorepo
fd8d420999 bgpd : Ensure logging for dynamic neighbor listen limit reached
Dynamic neighbors exceeding the listen limit were rejected without appropriate logging.
Previously, only rejection logs were generated, leaving users unaware of when the limit being reached.
Adding a log message for when the listen limit is reached

Signed-off-by: Pooja Rathore <rathorepo@vmware.com>
2024-04-29 08:33:04 +00:00
Donatas Abraitis
2187b82714
Merge pull request #15670 from poojarathore30/pg-deletion-with-listen-range
bgpd : Prevent deletion of BGP peer groups associated to listen range
2024-04-29 11:29:07 +03:00
rathorepo
48faeafe16 bgpd : Prevent deletion of BGP peer groups associated to listen range
Description:
-----
Deleting a peer group also deletes its associated BGP listen range.
This behaviour is undesired as it could cause unintended configuration changes.

Fix :
-----
-Do not allow peer group deletion until they are no longer associated with any listen range.
-Check the count of listen ranges attached to the group.
If any listen ranges are found, returns a configuration warning, preventing the deletion.

Signed-off-by: Pooja Rathore <rathorepo@vmware.com>
2024-04-27 16:44:26 +00:00
anlan_cs
e942d1f6a2 bgpd: fix the dead code
Fixed the Coverity issue 1586018:
Control flow issues (DEADCODE) /bgpd/bgp_ecommunity.c: 1402 in ecommunity_ecom2str()

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-28 00:05:36 +08:00
Russ White
1a9c3a710d
Merge pull request #15782 from opensourcerouting/fix/drop_srte_color_flag
bgpd: Drop SRTE_COLOR attribute flag
2024-04-27 08:19:09 -04:00
Donatas Abraitis
d3c556652a
Merge pull request #15845 from pguibert6WIND/bmp_improvements
Bmp improvements about statistics
2024-04-26 23:24:54 +03:00
Russ White
f19817f71d
Merge pull request #15723 from opensourcerouting/feature/extended_link_bw_refactored_v1
bgpd: Implement extended link-bandwidth
2024-04-26 14:41:05 -04:00
Philippe Guibert
500227ae76 bgpd: add bmp loc-rib 64 bit gauge value
There is no support for option 8, as per RFC7854.
Add the 64 bit counter in the peer structure.
Add the missing per peer statistic.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-26 08:12:41 +02:00
Philippe Guibert
7ba991cf96 bgpd: add 'bmp stat send-experimental' command
Some wireshark versions can not decode the experimental
bmp stat code. This may also be the case for some collectors.
Add a vty command to be able to disable bmp to sending
those values.

> [no] bmp stat send-experimental

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-26 08:12:38 +02:00
Philippe Guibert
e6374a20f3 bgpd: add bmp adj-rib-in 64 bit gauge value
There is no support for option 7, as per RFC7854.
Add the 64 bit counter in the peer structure.
Add the 64 bit bmp value write api.
Add the missing per peer statistic.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-26 08:11:44 +02:00
Donald Sharp
b4c64b3a39 bgpd: Remove unused addition found in clang
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-25 14:45:32 -04:00
Mark Stapp
3a59d4f984 lib,bgpd,vtysh: move bgp vty defines to lib
Stop including a bgp header file from vtysh; move a couple
of cli string defines to a library header.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-24 08:23:12 -04:00
Donatas Abraitis
4cedd22253
Merge pull request #15766 from louis-6wind/fix-network-rd
bgpd: fix show run of network route-distinguisher
2024-04-24 14:34:19 +03:00
Donald Sharp
3fa7876304
Merge pull request #15819 from louis-6wind/fix-snmp-oid
bgpd, ospfd: fix non increasing SNMP OID
2024-04-24 07:25:22 -04:00
Donald Sharp
d7a33de67f
Merge pull request #15810 from opensourcerouting/fix/enforce_first_as_bgp_peer-group
bgpd: Inherit some peer flags from the peer-group
2024-04-23 12:57:24 -04:00
Louis Scalbert
c1124a44c3 Revert "bgpd: fix pointer arithmetic in bgp snmp module"
This reverts commit d9bd9ebbf1.

The previous code was correct even if the coverity scanner was
complaining.

Fixes: https://github.com/FRRouting/frr/issues/15680
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:39:29 +02:00
Louis Scalbert
3d3a138f5a bgpd: fix show run of network route-distinguisher
Route-distinguisher (RD) is not printed properly in show run:

>  address-family ipv6 vpn
>   network ff01::/64 rd (null) label 7
>   network ff01::/64 rd (null) label 8

ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi") merged
bgp_static_set_safi into bgp_static_set but inadvertently omitted the
handling of prd_pretty.

Copy the pretty RD string if available.

> address-family ipv6 vpn
>  network ff01::/64 rd 75:5 label 7
>  network ff01::/64 rd 85:5 label 8

Fixes: ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 10:39:21 +02:00
Donatas Abraitis
bb7b0ff01f
Merge pull request #15536 from ak503/bgp_bfd
bgpd: fix disable bfd profile for neighbors.
2024-04-23 11:09:11 +03:00
Donatas Abraitis
0a6f661eae
Merge pull request #15717 from pguibert6WIND/vrf_label_allocate_when_necessary
bgpd: do allocate vrf label only when necessary
2024-04-23 11:08:21 +03:00
Donatas Abraitis
634d1375fa bgpd: Update IPv6 extended community sub-type for extended link bandwidth
Already assigned by IANA, just the draft is not yet updated.

https://www.iana.org/assignments/bgp-extended-communities/bgp-extended-communities.xhtml#trans-ipv6

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-23 08:55:00 +03:00
Donatas Abraitis
4d3e679b04 bgpd: Use snprintfrr() to print PRIu64 for ipv6_ecommunity_lb_str()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
0703ae35cc bgpd: Include IPv6 extended community into multipath considerations
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
d92a284523 bgpd: Extract link bandwidth from IPv6 extended community if received
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
a988a0a88a *: Use uint64_t for weight down the path to Zebra
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
e53bd69326 bgpd: Allow sending extended communities between OAD peers
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
09e2a362a3 bgpd: Implement draft-li-idr-link-bandwidth-ext-01
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
b29fdafa3f bgpd: Print IPv6 extended communities for show bgp <prefix>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
c8a2532ab3 bgpd: Add neighbor ... extended-link-bandwidth command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:07 +03:00
Donatas Abraitis
540f81c346 bgpd: Print IPv6 extended community for show bgp attribute-info
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:49:16 +03:00
Donatas Abraitis
c4986af74e bgpd: Adopt ecommunity_linkbw_present for IPv6 extended communities
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:49:16 +03:00
Donatas Abraitis
d9219ee847 bgpd: Drop non ieee encoding parsing for ipv6 extended communities
Link-bandwidth is encoded into extended community, not ipv6 extended community.

Thus it's not needed here at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:49:00 +03:00
Donatas Abraitis
e0b64f2414 bgpd: Convert 32-bit to 64-bit link bandwidth variable (link_bw)
This is needed to implement and use larger bandwidths rather than limiting only
to theoretical 34Gbps max bandwidth.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:48:37 +03:00
Donatas Abraitis
83109e3f66 bgpd: Do not reset the session when toggling dynamic capability
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 22:29:32 +03:00
Donatas Abraitis
70631acbb8 bgpd: Inherit capability dynamic flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 14:19:12 +03:00
Donatas Abraitis
9c9f9ce3c1 bgpd: Inherit capability software-version flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 14:18:39 +03:00
Donatas Abraitis
6486afe8d5 bgpd: Inherit enforce-first-as flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-21 14:16:49 +03:00
Donatas Abraitis
0605ec9f84
Merge pull request #15472 from louis-6wind/ipv6-table-direct
bgpd: add redistribute table-direct command for ipv6-unicast
2024-04-20 11:28:04 +03:00
Donatas Abraitis
79cf6512f4 bgpd: Include capabilities when sending NOTIFICATION(7)
RFC5492 says:

This document defines a new Error Subcode, Unsupported Capability.
   The value of this Subcode is 7.  The Data field in the NOTIFICATION
   message MUST list the set of capabilities that causes the speaker to
   send the message.  Each such capability is encoded in the same way as
   it would be encoded in the OPEN message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-18 17:44:51 +03:00
Philippe Guibert
8b27521cfa bgpd: do allocate vrf label only when necessary
Today, with the following bgp instance configured, the
local VRF label is allocated even if it is not used.

> router bgp 65500 vrf vrf1
>  address-family ipv4 unicast
>   label vpn export allocation-mode per-nexthop
>   label vpn export auto
>   rd vpn export 444:1
>   rt vpn both 52:100
>   export vpn
>   import vpn

The 'show mpls table' indicates that the 16 label value
is allocated, but never used in the exported prefixes.

> r1# show mpls table
>  Inbound Label  Type  Nexthop         Outbound Label
>  -----------------------------------------------------
>  16             BGP   vrf1            -
>  17             BGP   192.168.255.13  -
>  18             BGP   192.0.2.12      -
>  19             BGP   192.0.2.11      -

Fix this by only allocating new label values when really
used. Consequently, only 3 labels will be allocated instead
of previously 4.

> r1# show mpls table
>  Inbound Label  Type  Nexthop         Outbound Label
>  -----------------------------------------------------
>  16             BGP   192.168.255.13  -
>  17             BGP   192.0.2.11      -
>  18             BGP   192.0.2.12      -

Fixes: 577be36a41 ("bgpd: add support for l3vpn per-nexthop label")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-18 14:55:25 +02:00
Donatas Abraitis
8ea02843dc
Merge pull request #15780 from donaldsharp/rpki_as_0
bgpd: Allow specification of AS 0 for rpki commands
2024-04-18 09:31:39 +03:00
Donatas Abraitis
619321de78 bgpd: Drop SRTE_COLOR attribute flag
SRTE_COLOR is not defined at all as an attribute, it was a mistake from the
beginning.

SRTE_COLOR is extended community, can't see the reason having it as a community,
and a separate attribute.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-17 22:50:44 +03:00
Donald Sharp
cfee4e3cf5 bgpd: Allow specification of AS 0 for rpki commands
RFC-7607 specifically calls out the allowed usage
of AS 0 to signal that the a particular address is
not in use and should be guarded against.  Add
the ability to specify this special AS in the rpki
commands.

eva# show rpki  as-number 0
RPKI/RTR prefix table
Prefix                                   Prefix Length  Origin-AS
2.57.180.0                                  22 -  24   0
2.58.144.0                                  22 -  22   0
2.59.116.0                                  24 -  24   0
4.42.228.0                                  22 -  22   0
5.57.80.0                                   22 -  22   0
<snip>
2a13:df87:b400::                            38 -  38   0
2a13:df84::                                 32 -  32   0
2630::                                      16 -  16   0
Number of IPv4 Prefixes: 1166
Number of IPv6 Prefixes: 617

eva# show rpki prefix 2630::/16 0
Prefix                                   Prefix Length  Origin-AS
2630::                                      16 -  16   0
eva#

Fixes: #15778
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-17 09:42:26 -04:00
Louis Scalbert
bc529cf92b bgpd: cleanup references to debug bgp allow-martians
The debug command was removed in 17e9298e47 ("bgpd: Remove 'debug bgp
allow-martian'")

Cleanup all references to the debug command.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-17 09:55:54 +02:00
Philippe Guibert
2a384f14c1 bgpd: add redistribute table-direct command for ipv6-unicast
The 'table-direct' redistribute command is available for ipv4 unicast but
not for ipv6 unicast.

Add the command to ipv6 unicast as well.

Fixes: b6367f8460 ("bgpd: add redistribute table-direct support")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-16 15:12:58 +00:00
Russ White
0719f6f513
Merge pull request #15733 from opensourcerouting/fix/json_output_for_show_bgp_ipv4_unicast_json_detail
bgpd: Drop newline in JSON output for `show bgp afi safi json detail`
2024-04-16 10:15:20 -04:00
Russ White
ee77989ffa
Merge pull request #15732 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd
bgpd: Drop `bgp_network_import_check_exact_cmd` command
2024-04-16 10:14:41 -04:00
Russ White
057d56ee29
Merge pull request #15726 from donaldsharp/med_value
bgpd: Fix display when using `missing-as-worst`
2024-04-16 10:14:12 -04:00
Russ White
1c043440ea
Merge pull request #15572 from donaldsharp/best_path_stuff_sigh
bgp_process work
2024-04-16 07:52:09 -04:00