Commit Graph

35208 Commits

Author SHA1 Message Date
Vijayalaxmi Basavaraj
92220b2d05 pimd: fix crash unconfiguring rp keepalive timer
pimd crashs while unconfigure of rp ka timer as we are trying to access
a yand dnode(suppress timer) which does not exist at the moment.

User just configured rp keepalive timer and not suppress timer,
the yang dnode would not be present. Instead of directly accessing
yang_dnode_get_unit16, first check the yang node exist using
the xpath.

Ticket: #3874971

Testing:

Before:
------
tor-11(config)# no ip pim rp keep-alive-timer 3000
vtysh: error reading from pimd: Success (0)Warning: closing connection to pimd because of an I/O error!

Broadcast message from root@tor-11 (somewhere) (Mon Apr 22 17:29:12 2024):

cumulus-core: Running cl-support for core files "pimd.25467.1713806952.core"

After:
-----
tor-11(config)# no ip pim rp keep-alive-timer 3000
tor-11(config)#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Vijayalaxmi Basavaraj <vbasavaraj@nvidia.com>
(cherry picked from commit 0c4b7c1f1f)
2024-04-27 03:29:05 +00:00
Donatas Abraitis
2a1d1cda75
Merge pull request #15830 from FRRouting/mergify/bp/stable/10.0/pr-15819
bgpd, ospfd: fix non increasing SNMP OID (backport #15819)
2024-04-25 08:01:04 +03:00
Donatas Abraitis
8bd3602914
Merge pull request #15832 from FRRouting/mergify/bp/stable/10.0/pr-15766
bgpd: fix show run of network route-distinguisher (backport #15766)
2024-04-25 08:00:46 +03:00
Donald Sharp
30b4d00758
Merge pull request #15828 from opensourcerouting/fix/backport_inherit_flags
bgpd: Inherit some peer flags from the peer-group
2024-04-24 10:15:43 -04:00
Louis Scalbert
16600df2c4 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>
(cherry picked from commit 3d3a138f5a)
2024-04-24 11:35:40 +00:00
Louis Scalbert
9e5acccacb 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>
(cherry picked from commit c1124a44c3)
2024-04-24 11:26:21 +00:00
Louis Scalbert
698a1808c7 Revert "ospfd: fix some dicey pointer arith in snmp module"
This reverts commit 438ef98701.

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>
(cherry picked from commit c7895ba320)
2024-04-24 11:26:21 +00:00
Donatas Abraitis
7f53f996e1 bgpd: Inherit capability software-version flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-24 12:04:56 +03:00
Donatas Abraitis
0ade422bdf bgpd: Inherit enforce-first-as flag from the peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-24 12:04:52 +03:00
Donald Sharp
147e933fd2
Merge pull request #15820 from FRRouting/mergify/bp/stable/10.0/pr-15815
lib, zebra: Check for not being a blackhole route (backport #15815)
2024-04-23 12:53:22 -04:00
Donald Sharp
b116bcc8a2 lib, zebra: Check for not being a blackhole route
In zebra_interface_nhg_reinstall zebra is checking that the
nhg is a singleton and not a blackhole nhg.  This was originally
done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX,
NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX.  This
was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6.  These
were both possible to be received and maintained from the upper
level protocol for when a route is being recursively resolved.
If we have gotten to this point in zebra_interface_nhg_reinstall
the nexthop group has already been installed at least once
and we *know* that it is actually a valid nexthop.  What the
test is really trying to do is ensure that we are not reinstalling
a blackhole nexthop group( Which is not possible to even be
here by the way, but safety first! ).  So let's change
to test for that instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 29c1ff446e)
2024-04-23 12:10:34 +00:00
Igor Ryzhov
0902affc8e
Merge pull request #15804 from FRRouting/mergify/bp/stable/10.0/pr-15798
vtysh: Fix `show route-map` command when calling via `do` (backport #15798)
2024-04-21 13:04:16 +03:00
Donatas Abraitis
d70ebb5a2e vtysh: Fix show route-map command when calling via do
Before:

```
ton(config)# do sh route-map
% [ZEBRA] Unknown command: show route-map
% [BGP] Unknown command: show route-map
% [ISIS] Unknown command: show route-map
```

Fixes: 570fdc55fd ("lib,vtysh: fix show route map JSON output")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9b8f18a66c)
2024-04-20 13:07:05 +00:00
Donatas Abraitis
0c8c1e2fdd
Merge pull request #15785 from FRRouting/mergify/bp/stable/10.0/pr-15770
lib, zebra: fix exit commands (backport #15770)
2024-04-18 22:11:47 +03:00
Donatas Abraitis
9cfa36b12b
Merge pull request #15760 from FRRouting/mergify/bp/stable/10.0/pr-15726
bgpd: Fix display when using `missing-as-worst` (backport #15726)
2024-04-18 11:51:03 +03:00
Igor Ryzhov
13bb2b2125 lib, zebra: fix exit commands
If a command is not marked as `YANG`-converted, the current command
batching buffer is flushed before executing the command. We shouldn't
flush the buffer when executing an `exit` command. It should only be
flushed if the next command is not `YANG`-converted, which is checked by
the command itself, not the previous `exit`.

Fixes #15706.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 57811a53ba)
2024-04-18 06:34:21 +00:00
Jafar Al-Gharaibeh
a4cea5cf15
Merge pull request #15763 from FRRouting/mergify/bp/stable/10.0/pr-15733
bgpd: Drop newline in JSON output for `show bgp afi safi json detail` (backport #15733)
2024-04-18 01:33:55 -05:00
Igor Ryzhov
670b9fcab8
Merge pull request #15779 from FRRouting/mergify/bp/stable/10.0/pr-15758
debian, redhat, snapcraft: Libyang min version is 2.1.128 (backport #15758)
2024-04-18 00:35:06 +03:00
Martin Winter
0bf5b7781c debian, redhat, snapcraft: Libyang min version is 2.1.128
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit 81d63e476a)
2024-04-17 15:11:31 +00:00
Donald Sharp
ecc23b7716
Merge pull request #15773 from FRRouting/mergify/bp/stable/10.0/pr-15709
tools: frr-reload strip interface vrf ctx line (backport #15709)
2024-04-17 09:17:55 -04:00
Donald Sharp
1240cd6d8c
Merge pull request #15764 from FRRouting/mergify/bp/stable/10.0/pr-15755
vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI (backport #15755)
2024-04-17 09:17:37 -04:00
Chirag Shah
3be078253c tools: frr-reload strip interface vrf ctx line
if frr.conf file contains 'interface x vrf <name> config
it causes protocol (like ospf) neighbor session flap,
as it deletes interface base config line ('interface x') from
running config and readds with 'interface x vrf <name>'
line from frr.conf.
This deletion and readdition of lines leads to neighborship
flaps.

This issue is by product of (PR-10411 | https://github.com/FRRouting/frr/pull/10411)
(commit id: 788a036fdb)
where running config for interface config no loger displays associated
vrf line.

Ticket: #3858146
Testing:

frr.conf
interface swp1.2 vrf vrf1012
ip ospf network point-to-point

running-config:
interface swp1.2
 ip ospf network point-to-point
 exit

Before fix:
frr-reload logs:

2024-04-09 00:28:31,096  INFO: Executed "interface swp1.2  no ip ospf
network point-to-point exit"

 'interface swp1.2 vrf vrf1012\n ip ospf network
 point-to-point\nexit\n',

After fix:
frr-reload strips vrf line, thus no config change between
frr.conf and running config.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit c1356f0e85)
2024-04-17 07:42:49 +00:00
Donatas Abraitis
d1c20b9ac7 vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit d9d6db4582)
2024-04-16 14:20:38 +00:00
Donatas Abraitis
d6da504af7 bgpd: Drop newline in JSON output for show bgp afi safi json detail
Before:

```
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 2,
 "routerId": "1.1.1.1",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "192.168.1.0/24": {
"prefix": "192.168.1.0/24",
"version": "1",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":1,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
} ,"192.168.11.0/24": {
"prefix": "192.168.11.0/24",
"version": "2",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":2,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
}  }  }
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 1dc28e1d73)
2024-04-16 14:16:39 +00:00
Donald Sharp
c305042330 bgpd: Fix display when using missing-as-worst
The usage of the `bgp bestpath med missing-as-worst` command
was being accepted and applied during bestpath, but during output
of the routes affected by this it would not give any indication
that this was happening or what med value was being used.

Fixes: #15718
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit bc9885b22e)
2024-04-16 14:15:18 +00:00
Donatas Abraitis
0cccf718e7
Merge pull request #15751 from FRRouting/mergify/bp/stable/10.0/pr-15749
zebra: fix encoded DNSSL length (backport #15749)
2024-04-16 12:01:02 +03:00
Igor Ryzhov
0498c47e59 zebra: fix encoded DNSSL length
The encoded DNSSL length is not set so the value is missing from RA
packet.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 8d6f7a4397)
2024-04-16 04:20:40 +00:00
Jafar Al-Gharaibeh
03a143cd49 FRR Release 10.0
Major highlights:
-   Introduce local host routes
-   Require libyang 2.1.128
-   Add suport to configure a log file per daemon
-   BGP BMP Loc-RIB (RFC9069) support
-   eBGP-OAD (One Administrative Domain) support
-   BGP RPKI VRF support
-   BGP SNMP traps for BGP4-MIBV2
-   Management (mgmtd) daemon "replace" operation support
-   BGP dynamic capabilities for addpath, fqdn, orf capabilities
-   SRv6 encapsulation source address feature
-   OSPFv3 Point-To-Multipoint mode
-   bgpd
    * Add clear bgp capabilities command to resend some dynamic capabilities link
    * bgpd: Add debug bgp updates detail command link
    * Add debug bgp updates <in|out> <X.Y.Z.W> prefix-list <NAME> command link
    * Add neighbor capability fqdn command link
    * Add redistribute table-direct support link
    * Fix match ip address ... + match evpn ... commands for EVPN
    * Remove aggregated (summary-only) suppressed routes from EVPN
-   mgmtd
    * Implement full XPATH 1.0 predicate functionality
    * Output staticd configuration from mgmtd
-   ospfd
    * Fix crash in OSPF TE parsing
-   ospf6d
    * Advertise local addresses with la bit
    * Set loopback interface cost to 0
    * Let the user override interface cost for a loopback
-   pathd
    * Add dynamic candidate path metric [computed] keyword link
    * Add no msd command in the pcc context
    * Add no pcep command
-   vtysh
    * Send interface commands to mgmtd
-   watchfrr
    * Extend the ignore option to the daemon being killed
-   zebrad
    * Add mpls label dynamic-block command link
    * Add JSON support to show debugging label-table link
    * Add zebra to mgmtd oper-state
    * Allow longer prefix matches for the next hops
    * Push all configured IP addresses when the interface comes up
    * Remove static ARP entries on interface-down events
    * Support to listen teamd netlink message as bond type
    * Fix crash when macvlan link-interface is in another netns

Breaking Changes:
-   Enable enforce-first-as by default for BGP
-   noprefixroute flag for interface prefixes with NetworkManager
-   Deprecate confd

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-04-08 12:17:26 -05:00
Jafar Al-Gharaibeh
c1e0b1b24c debian,redhat: update for 10.0 release
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-04-08 12:15:26 -05:00
Donatas Abraitis
ec3d1397b1
Merge pull request #15689 from FRRouting/mergify/bp/dev/10.0/pr-15640
bgpd: Fix errors handling for MP/GR capabilities as dynamic capability (backport #15640)
2024-04-07 18:37:03 +03:00
Donald Sharp
1b46f4af97
Merge pull request #15683 from opensourcerouting/fix/revert_0325116a27258e1df773a046e8668a029bead60c_10.0
Revert [10.0] bgpd: fix 6vpe nexthop
2024-04-05 19:28:17 -04:00
Donatas Abraitis
2a5ea423ef bgpd: Fix errors handling for MP/GR capabilities as dynamic capability
When receiving a MP/GR capability as dynamic capability, but malformed, do not
forget to advance the pointer to avoid hitting infinity loop.

After:
```
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [GS0AQ-HKY0X] 127.0.0.1 rcv CAPABILITY
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 5, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 0, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 0, code: 0, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 0, code: 0, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 0, code: 0, length 1
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
```

Before:
```
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 30a332dad8)
2024-04-05 17:42:52 +00:00
Donatas Abraitis
34dbb82631
Merge pull request #15662 from FRRouting/mergify/bp/dev/10.0/pr-15634
Suppress fib funny business (backport #15634)
2024-04-05 00:18:44 +03:00
Donatas Abraitis
362875ff4b Revert "topotests: add an ebgp 6vpe test"
This reverts commit 4d7df91752.
2024-04-04 20:07:55 +03:00
Donatas Abraitis
0966f80ff7 Revert "bgpd: fix 6vpe nexthop"
This reverts commit 0325116a27.
2024-04-04 20:07:53 +03:00
Donald Sharp
fbfcc77679 bgpd: Arrange peer notification to after zebra announce
Currently BGP attempts to send route change information
to it's peers *before* the route is installed into zebra.
This creates a bug in suppress-fib-pending in the following
scenario:

a) bgp suppress-fib-pending and bgp has a route with
2 way ecmp.
b) bgp receives a route withdraw from peer 1.  BGP
will send the route to zebra and mark the route as
FIB_INSTALL_PENDING.
c) bgp receives a route withdraw from peer 2.  BGP
will see the route has the FIB_INSTALL_PENDING and
not send the withdrawal of the route to the peer.
bgp will then send the route deletion to zebra and
clean up the bgp_path_info's.

At this point BGP is stuck where it has not sent
a route withdrawal to downstream peers.

Let's modify the code in bgp_process_main_one to
send the route notification to zebra first before
attempting to announce the route.  The route withdrawal
will remove the FIB_INSTALL_PENDING flag from the dest
and this will allow group_announce_route to believe
it can send the route withdrawal.

For the master branch this is ok because the recent
backpressure commits are in place and nothing is going
to change from an ordering perspective in that regards.
Ostensibly this fix is also for operators of Sonic and
will be backported to the 8.5 branch as well.  This will
change the order of the send to peers to be after the
zebra installation but sonic users are using suppress-fib-pending
anyways so updates won't go out until rib ack has been
received anyways.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 329d5a5cbb)
2024-04-03 06:52:16 +00:00
Donald Sharp
34f70dee81 bgpd: Note when receiving but not understanding a route notification
When BGP has been asked to wait for FIB installation, on route
removal a return call is likely to not have the dest since BGP
will have cleaned up the node, entirely.  Let's just note that
the prefix cannot be found if debugs are turned on and move on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7c60314652)
2024-04-03 06:52:16 +00:00
Donatas Abraitis
319d540115
Merge pull request #15656 from FRRouting/mergify/bp/dev/10.0/pr-15628
bgpd: Fix error handling when receiving BGP Prefix SID attribute (backport #15628)
2024-04-02 22:29:11 +03:00
Donatas Abraitis
781e084c20 bgpd: Prevent from one more CVE triggering this place
If we receive an attribute that is handled by bgp_attr_malformed(), use
treat-as-withdraw behavior for unknown (or missing to add - if new) attributes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit babb23b748)
2024-04-02 15:18:36 +00:00
Donatas Abraitis
81b536bff9 bgpd: Fix error handling when receiving BGP Prefix SID attribute
Without this patch, we always set the BGP Prefix SID attribute flag without
checking if it's malformed or not. RFC8669 says that this attribute MUST be discarded.

Also, this fixes the bgpd crash when a malformed Prefix SID attribute is received,
with malformed transitive flags and/or TLVs.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ba6a8f1a31)
2024-04-02 15:18:35 +00:00
Mark Stapp
b051d50335
Merge pull request #15650 from FRRouting/mergify/bp/dev/10.0/pr-15647
zebra: don't deref vxlan-vni array (backport #15647)
2024-04-02 08:41:02 -04:00
Mark Stapp
7dcbe2b106 zebra: don't deref vxlan-vni array
Null-check the vxlan-vni array info coming into zebra from
the dataplane.

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit 75ef259b1d)
2024-04-01 20:32:24 +00:00
Jafar Al-Gharaibeh
643515b644
Merge pull request #15641 from FRRouting/mergify/bp/dev/10.0/pr-15635
bgpd: fix srv6 memory leak detection (backport #15635)
2024-03-31 23:42:48 -05:00
Jafar Al-Gharaibeh
f651b2bdb3
Merge pull request #15644 from FRRouting/mergify/bp/dev/10.0/pr-15632
vtysh, zebra: fix malformed json output for multiple vrfs in command 'show ip route vrf all json' (backport #15632)
2024-03-31 23:42:09 -05:00
Piotr Suchy
eb707e756f vtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ip route vrf all json'
Command 'show ip route vrf <vrf_name> json' returns a valid json object,
however if instead of <vrf_name> we specify 'all', we get an invalid json
object, like:

{//vrf1 routes}{//vrf2 routes}{vrf3 routes}

After the fix:

{"vrf1":{//vrf1 routes},"vrf2:{//vrf2 routes},"vrf3":{//vrf3 routes}}

Which is a valid json object, that can be parsed effectively using built-in
modules. The rest of the commands remains unaffected and behave the same.

Signed-off-by: Piotr Suchy <psuchy@akamai.com>
(cherry picked from commit 0e2fc3d67f)
2024-03-30 20:39:41 +00:00
Philippe Guibert
5fdf30741d bgpd: fix srv6 memory leak detection
The asan memory leak has been detected:
> Direct leak of 16 byte(s) in 1 object(s) allocated from:
>     #0 0x7f9066dadd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
>     #1 0x7f9066779b5d in qcalloc lib/memory.c:105
>     #2 0x556d6ca527c2 in vpn_leak_zebra_vrf_sid_update_per_af bgpd/bgp_mplsvpn.c:389
>     #3 0x556d6ca530e1 in vpn_leak_zebra_vrf_sid_update bgpd/bgp_mplsvpn.c:451
>     #4 0x556d6ca64b3b in vpn_leak_postchange bgpd/bgp_mplsvpn.h:311
>     #5 0x556d6ca64b3b in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3751
>     #6 0x556d6cb9f116 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3337
>     #7 0x7f906685a6b6 in zclient_read lib/zclient.c:4490
>     #8 0x7f9066826a32 in event_call lib/event.c:2011
>     #9 0x7f906675c444 in frr_run lib/libfrr.c:1217
>     #10 0x556d6c980d52 in main bgpd/bgp_main.c:545
>     #11 0x7f9065784c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Fix this by freeing the previous memory chunk.

Fixes: b72c9e1475 ("bgpd: cli for SRv6 SID alloc to redirect to vrf (step4)")
Fixes: 527588aa78 ("bgpd: add support for per-VRF SRv6 SID")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit eea8a8ae24)
2024-03-30 15:09:38 +00:00
Igor Ryzhov
b5edaf7739
Merge pull request #15606 from FRRouting/mergify/bp/dev/10.0/pr-15602
mgmtd: fix a couple of log messages (backport #15602)
2024-03-25 14:37:06 +02:00
Donatas Abraitis
4cd6de9e14
Merge pull request #15601 from FRRouting/mergify/bp/dev/10.0/pr-15010
zebra: Fix crash on macvlan link down/up (backport #15010)
2024-03-25 08:23:32 +02:00
Igor Ryzhov
9f24fe84ac mgmtd: fix a couple of log messages
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 988d4444d4)
2024-03-22 20:58:17 +00:00
Igor Ryzhov
11fad42e6f
Merge pull request #15596 from FRRouting/mergify/bp/dev/10.0/pr-15587
grpc: fix grpc for various failures (backport #15587)
2024-03-22 15:37:55 +02:00