Commit Graph

34938 Commits

Author SHA1 Message Date
David Lamparter
37d5dc445d pimd: fix dr-priority range
0 is a valid DR priority.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b564c1d890)
2024-05-09 13:54:46 +00:00
Donald Sharp
fb66adb680
Merge pull request #15970 from FRRouting/mergify/bp/stable/10.0/pr-15920
zebra: fix EVPN svd based remote nh neigh del (backport #15920)
2024-05-09 07:10:36 -04:00
Chirag Shah
b3c5bf38cc zebra: fix EVPN svd based remote nh neigh del
In the context of SVD (Single VxLAN Device) for L3VNI,
the remote VTEP's nexthop is programmed neighbor entry against
SVD along with neighbor entry against SVI.

However, when L3VNI is removed or the VRF is disabled, all SVI
based remote nexthop neighbors are uninstalled and deleted.
The SVD based neigh entries remains in Zebra and the Kernel.
Subsequently, when reconfiguring L3VNI and relearning the same nexthop,
the neighbor entry is not programmed is because it is not removed
from Zebra SVD neighbor hash table, leading to the failure to
reprogram the entry.

With this fix, the SVD nexthop neigh entry is uninstalled
and deleted from Zebra and Kernel.

Ticket: #3729045

Testing:

borderleaf:# ip neigh show 2.2.2.2
2.2.2.2 dev vlan2560_l3 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra
2.2.2.2 dev vxlan99 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra

With the fix:

Zebra log shows both enties SVD (vxlan99) and SVI (vlan2560_l3)
neighbor entries are deleted.

2024/05/03 18:41:33.527125 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vxlan99(16) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0
2024/05/03 18:41:33.527128 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vlan2560_l3(18) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0

borderleaf:# ip neigh show 2.2.2.2
borderleaf:#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit fde6dd7bb9)
2024-05-08 19:38:18 +00:00
Donald Sharp
66dfa94aed
Merge pull request #15956 from FRRouting/mergify/bp/stable/10.0/pr-15895
bgpd: Ignore validating the attribute flags if path-attribute is configured (backport #15895)
2024-05-08 09:57:28 -04:00
Donald Sharp
51b98d1088
Merge pull request #15958 from FRRouting/mergify/bp/stable/10.0/pr-15913
bgpd: Fix `no set as-path prepend ASNUM...` (backport #15913)
2024-05-08 09:56:49 -04:00
Donatas Abraitis
bd5f571b42
Merge pull request #15952 from FRRouting/mergify/bp/stable/10.0/pr-15846
ospfd: fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset hello timer (backport #15846)
2024-05-08 14:47:26 +03:00
Donatas Abraitis
7472bc5bca
Merge pull request #15951 from FRRouting/mergify/bp/stable/10.0/pr-15883
bgpd: Apply NOOP when doing negative commands for GR operations (backport #15883)
2024-05-08 06:56:24 +03:00
Donatas Abraitis
6a0120044f bgpd: Allow using optional table id for negative no set table X command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e411988a86)
2024-05-07 14:53:18 +00:00
Donatas Abraitis
6187683659 bgpd: Fix no set as-path prepend ASNUM...
If entering `no set as-path prepend 1 2 3`, it's warned as unknown command.

Now fixed, and the following combinations work fine:

```
no set as-path prepend
no set as-path prepend last-as
no set as-path prepend last-as 1
no set as-path prepend 1
no set as-path prepend 1 2
```

Fixes: https://github.com/FRRouting/frr/issues/15912

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e069a1c8d5)
2024-05-07 14:53:17 +00:00
Donatas Abraitis
7dd8171d21 tests: Check if iBGP session can drop invalid AIGP attribute
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit f58227c91e)
2024-05-07 14:46:12 +00:00
Donatas Abraitis
be8f8118b5 bgpd: Ignore validating the attribute flags if path-attribute is configured
E.g. Cisco sends AIGP attribute as transitive, but it's wrong. Hence, the session
is teared down, because of this bgp_attr_flag_invalid() test.

Relax this check if we have `neighbor X path-attribute <discard|treat-as-withdraw>`
configured.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 714e5be9a0)
2024-05-07 14:46:12 +00:00
Russ White
0b27a7d2fa
Merge pull request #15870 from opensourcerouting/fix/1ce626aea6f1f274da92478a8e487c229b08f9ce_10.0
vtysh: Show `ip ospf network ...` even if it's not the same as the interface type
2024-05-07 10:42:11 -04:00
Bing Shui
b0c7b88091 ospfd:fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset hello timer
Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
(cherry picked from commit d733fe2c04)
2024-05-07 13:59:24 +00:00
Donatas Abraitis
25986a7f5b bgpd: Apply NOOP when doing negative commands for GR operations
E.g.:

```
% The Graceful Restart command used is not valid at this moment.
zsh: exit 1     vtysh -c configure -c 'router bgp' -c 'no neighbor 127.0.0.1 graceful-restart
1
```

This does not make sense frr-reload to fail.

Instead, just ignore such requests if they are just NOOP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9ebdb8e80d)
2024-05-07 13:58:04 +00:00
Donatas Abraitis
9ca4407147 bgpd: Print old/new states of graceful restart FSM
To better debug what's going on before/after.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7b5595b61d)
2024-05-07 13:58:03 +00:00
Donald Sharp
6056a8ce40
Merge pull request #15935 from FRRouting/mergify/bp/stable/10.0/pr-15921
bgpd: Fix crash when deleting the SRv6 locator (backport #15921)
2024-05-06 10:24:02 -04:00
Carmine Scarpitta
238f2b0d14 bgpd: Fix the order of NULL check and ZAPI decode
When BGP receives an SRV6_LOCATOR_ADD message from zebra, it calls the
`bgp_zebra_process_srv6_locator_add()` function to process the message.
`bgp_zebra_process_srv6_locator_add()` decodes the message first, and
then if the pointer to the default BGP instance is NULL (i.e. the
default BGP instance is not configured yet), it returns early without
doing anything and without using the decoded message information.

This commit fixes the order of the operations executed by
`bgp_zebra_process_srv6_locator_add()`. We first ensure that the default
BGP instance is ready and we return early if it is not. Then, we decode
the message and do something with the information contained in it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit bdc2c7bc54)
2024-05-06 05:52:34 +00:00
Carmine Scarpitta
20593bf0fb bgpd: Fix crash when deleting the SRv6 locator
When BGP receives a `SRV6_LOCATOR_DEL` from zebra, it invokes
`bgp_zebra_process_srv6_locator_delete` to process the message.

`bgp_zebra_process_srv6_locator_delete` obtains a pointer to the default
BGP instance and then dereferences this pointer.

If the default BGP instance is not ready / not configured yet, this
pointer this pointer is `NULL` and dereferencing it causes BGP to crash.

This commit fix the issue by adding a a check to verify if the pointer
is `NULL` and returning early if it is.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit ae3241b96d)
2024-05-06 05:52:34 +00:00
Donatas Abraitis
8fb9a51728
Merge pull request #15906 from FRRouting/mergify/bp/stable/10.0/pr-15840
ospf6d: fix interface type vs. connected routes updates (backport #15840)
2024-05-05 09:15:44 +03:00
David Lamparter
40bbd9310f ospf6d: accept CLI no for point-to-multipoint
`point-to-multipoint` was missing on the removal variant of this CLI
command.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 52734fc8e5)
2024-05-04 14:07:55 +00:00
David Lamparter
7f63d9c436 ospf6d: force recalculate on interface_up
interface_up also handles changes to the interface type, i.e. broadcast
to ptp to ptmp.  Connected routes for these are different and must be
readvertised, which is done in ospf6_interface_recalculate_cost() - but
only if the cost changed.  Use the force variant here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit d7f54c4d56)
2024-05-04 14:07:55 +00:00
David Lamparter
a5c72eac13 ospf6d: fix loopback/ptp/ptmp conn. route checks
The code emitting connected routes was checking against the interface
state (which can also be lo/ptp/ptmp) rather than the interface type.
This was causing wrong IA prefixes for connected routes getting put up
out if the interface was down intermittently.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 4aa200c7c5)
2024-05-04 14:07:55 +00:00
David Lamparter
b12af0d5cd ospf6d: fix DEFUN formatting wrecked by clang
clang-format doesn't understand `DEFUN` and formats it rather ugly.
Standard approach was to skip these in clang-format, which hasn't
happened here sadly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b47657600b)
2024-05-04 14:07:55 +00:00
Donald Sharp
c1ed2ac754
Merge pull request #15916 from FRRouting/mergify/bp/stable/10.0/pr-15837
fix use of deprecated c-ares api (backport #15837)
2024-05-04 09:41:42 -04:00
Andrew Cooks
08d97fdf73 lib: replace deprecated ares_gethostbyname
c-ares has deprecated ares_gethostbyname() in version 1.28.0
Replace it with ares_getaddrinfo().

This fixes a build error on Fedora 40.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
(cherry picked from commit 89a2e4d825)
2024-05-03 12:42:10 +00:00
Andrew Cooks
718981b0fb lib: replace deprecated ares_process()
ares_process(...) has been deprecated.
Replace it with ares_process_fd(...)

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
(cherry picked from commit 4540fa0a3e)
2024-05-03 12:42:09 +00:00
Donatas Abraitis
13815b16ca
Merge pull request #15886 from FRRouting/mergify/bp/stable/10.0/pr-15851
tools: Handle seq num for BGP as-path in frr-reload.py (backport #15851)
2024-05-01 12:12:28 +03:00
Chirag Shah
46b8abe7e6 tools: Handle seq num for BGP as-path in frr-reload.py
If frr.conf has bgp as-path access-list clause without sequence number
then upon performing frr-rleoad, the running config clause with sequence
number will always be deleted and the new ones without sequence will
be re-added.
This could lead to blackholing until the config gets reapplied.

Testing:

frr.conf:
bgp as-path access-list important_internet_bgp_as_numbers permit _16509_

Running config:
bgp as-path access-list important_internet_bgp_as_numbers seq 5 permit
_16509_
!

Before fix
Upon frr-reload it deletes and readd line as without seq

2024-04-26 03:16:45,772  INFO: Executed "no bgp as-path access-list
important_internet_bgp_as_numbers seq 5 permit _16509_"

'bgp as-path access-list important_internet_bgp_as_numbers permit
_16509_\n'

After fix:
no form is not executed and no delta determine between frr.conf
and running-config.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 439c6f70b5)
2024-04-30 11:57:47 +00:00
Donatas Abraitis
dc7da5f5a5 vtysh: Show ip ospf network ... even if it's not the same as the interface type
ospfv3 shows this unconditionally, and ospfv2 does not show `ip ospf network ...` if the type of the interface matches the specified network.

Fixes: https://github.com/FRRouting/frr/issues/15817

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-29 16:29:56 +03:00
Donatas Abraitis
da47fa7006
Merge pull request #15856 from FRRouting/mergify/bp/stable/10.0/pr-15848
pimd: fix crash unconfiguring rp keepalive timer (backport #15848)
2024-04-27 21:15:29 +03:00
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