]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
18 months agoMerge pull request #13043 from FRRouting/mergify/bp/stable/8.5/pr-13026
Donatas Abraitis [Sun, 19 Mar 2023 20:58:04 +0000 (22:58 +0200)]
Merge pull request #13043 from FRRouting/mergify/bp/stable/8.5/pr-13026

pbrd:fix mismatching in match src-dst (backport #13026)

18 months agoMerge pull request #13045 from FRRouting/mergify/bp/stable/8.5/pr-13025
Donatas Abraitis [Sun, 19 Mar 2023 20:57:53 +0000 (22:57 +0200)]
Merge pull request #13045 from FRRouting/mergify/bp/stable/8.5/pr-13025

Ospf ti lfa leaks (backport #13025)

18 months agoospfd: Free up q_space in early return path
Donald Sharp [Fri, 17 Mar 2023 14:58:08 +0000 (10:58 -0400)]
ospfd: Free up q_space in early return path

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 52ff0e3ed4ea671f42e3ab5d6d97dd6312e2f87f)

18 months agoospfd: Fix ospf_ti_lfa drop of an entire table
Donald Sharp [Fri, 17 Mar 2023 14:37:40 +0000 (10:37 -0400)]
ospfd: Fix ospf_ti_lfa drop of an entire table

The new_rtrs variable was just generated and then dropped.  Let's
fix that entirely

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit eb7e14011fa19f4ecc18b0108c556cc1d82ee381)

18 months agopbrd:fix mismatching in match src-dst
Chirag Shah [Fri, 17 Mar 2023 04:47:07 +0000 (21:47 -0700)]
pbrd:fix mismatching in match src-dst

upstream commit 67765a232d has incorect
address family check which prevent from
deleting src/dst config under pbr rule.

Ticket:#3405024
Issue:3405024
Testing Done:

Config:

pbr-map map6 seq 1
 match src-ip 2000::200:100:100:0/96
 match dst-ip 2000::100:100:100:0/96
 set nexthop-group group3

Before:
torc-12(config)# pbr-map map6 seq 1
torc-12(config-pbr-map)# no match src-ip 2000::200:100:100:0/96
Cannot mismatch families within match src/dst

After:
torc-12(config)# pbr-map map6 seq 1
torc-12(config-pbr-map)# no match src-ip 2000::200:100:100:0/96
torc-12(config-pbr-map)#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 03494887eddaa255d9b6a217bfff60cc63cede42)

18 months agoMerge pull request #13035 from FRRouting/mergify/bp/stable/8.5/pr-13024
Donald Sharp [Sat, 18 Mar 2023 17:14:57 +0000 (13:14 -0400)]
Merge pull request #13035 from FRRouting/mergify/bp/stable/8.5/pr-13024

lib: Adjust only any flag for prefix-list entries if destroying (backport #13024)

18 months agolib: Adjust only `any` flag for prefix-list entries if destroying
Donatas Abraitis [Fri, 17 Mar 2023 12:48:35 +0000 (14:48 +0200)]
lib: Adjust only `any` flag for prefix-list entries if destroying

Before this patch, if we destroy `any` flag for a prefix-list entry, we always
set destination as 0.0.0.0/0 and/or ::/0.

This means that, if we switch from `ip prefix-list r1-2 seq 5 deny any` to
`ip prefix-list r1-2 seq 5 permit 10.10.10.10/32` we will have
`permit any` eventually, which broke ACLs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 61c07b9d43529f69f48ca54f4f0213cff52b5d0a)

18 months agotests: Check if route-map works correctly if modifying prefix-lists
Donatas Abraitis [Thu, 16 Mar 2023 12:39:40 +0000 (14:39 +0200)]
tests: Check if route-map works correctly if modifying prefix-lists

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a1e538178cb1ed09f6bbc0612605c5980bb9a3df)

18 months agoMerge pull request #13015 from FRRouting/mergify/bp/stable/8.5/pr-13009
Donatas Abraitis [Fri, 17 Mar 2023 22:04:59 +0000 (00:04 +0200)]
Merge pull request #13015 from FRRouting/mergify/bp/stable/8.5/pr-13009

bgpd: Use interface name instead of pointer value (backport #13009)

18 months agoMerge pull request #13021 from FRRouting/mergify/bp/stable/8.5/pr-13016
Donatas Abraitis [Fri, 17 Mar 2023 22:04:22 +0000 (00:04 +0200)]
Merge pull request #13021 from FRRouting/mergify/bp/stable/8.5/pr-13016

ospfd, ospfd6: Add more logging (backport #13016)

18 months agoospfd: Log Adjacency Changes with Neighbor IP in addition to Neighbor ID
Martin Winter [Wed, 26 Oct 2022 15:17:01 +0000 (08:17 -0700)]
ospfd: Log Adjacency Changes with Neighbor IP in addition to Neighbor ID

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 386d232a1a706310f4425d1a0ad6f08c32646e10)

18 months agoospfd, ospf6d: Add more logging details
Donatas Abraitis [Wed, 6 Apr 2022 19:15:57 +0000 (22:15 +0300)]
ospfd, ospf6d: Add more logging details

Basically just router-id or interface/IP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ba427e63489757756cd2b244315b1a911071bbc2)

18 months agobgpd: Use interface name instead of pointer value
Donald Sharp [Thu, 16 Mar 2023 14:24:25 +0000 (10:24 -0400)]
bgpd: Use interface name instead of pointer value

Log message is borked in a manner that makes it unusable:
bgpd[52]: [VX6SM-8YE5W][EC 33554460] 2000:31:0:53::2: nexthop_set failed, resetting connection - intf 0x561eb9005a30

Let's print out the interface name instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 50e049db76573210e3b9ccfa962e5259452ccbe3)

18 months agoMerge pull request #13001 from FRRouting/mergify/bp/stable/8.5/pr-12996
Donatas Abraitis [Wed, 15 Mar 2023 17:20:41 +0000 (19:20 +0200)]
Merge pull request #13001 from FRRouting/mergify/bp/stable/8.5/pr-12996

tools: frr-reload fix list value not present (backport #12996)

18 months agoMerge pull request #12987 from FRRouting/mergify/bp/stable/8.5/pr-12978
Donatas Abraitis [Wed, 15 Mar 2023 12:09:34 +0000 (14:09 +0200)]
Merge pull request #12987 from FRRouting/mergify/bp/stable/8.5/pr-12978

pimd: IN_MULTICAST needs host order (backport #12978)

18 months agotools: frr-reload fix list value not present
Chirag Shah [Wed, 15 Mar 2023 04:32:40 +0000 (21:32 -0700)]
tools: frr-reload fix list value not present

Check for value present in list before removing
as in certain python3 ValueError traceback is observed.

Traceback (most recent call last):
  File "/usr/lib/frr/frr-reload.py",
line 2278, in <module>
    (lines_to_add, lines_to_del, restart_frr)
= compare_context_objects(newconf, running)
  File "/usr/lib/frr/frr-reload.py",
line 1933, in compare_context_objects
    lines_to_add, lines_to_del
  File "/usr/lib/frr/frr-reload.py",
line 1549, in ignore_delete_re_add_lines
    lines_to_del.remove((ctx_keys, line))
ValueError: list.remove(x): x not in list

Ticket:#3389979
Issue:3389979

Testing Done:
With fix perform frr-relaod on frr.conf config where earlier
traceback was seen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 1543f58b5541c0ddb5e53bb7994136dcb5f836cb)

18 months agopimd: IN_MULTICAST needs host order
Donald Sharp [Sun, 12 Mar 2023 00:37:21 +0000 (19:37 -0500)]
pimd: IN_MULTICAST needs host order

New correct behavior:

eva# conf
eva(config)# ip pim rp 192.168.1.224 224.0.0.0/24
No Path to RP address specified: 192.168.1.224
eva(config)# ip pim rp 224.1.2.3 224.0.0.0/24
% Bad RP address specified: 224.1.2.3
eva(config)#

Fixes: #12970
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 8083e713562a44744c4c2f4a0aa5cc6e2b2170ff)

18 months agoFRR Release 8.5
Jafar Al-Gharaibeh [Mon, 13 Mar 2023 14:01:47 +0000 (09:01 -0500)]
FRR Release 8.5

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
18 months agodebian, redhat: updating changelog for new release
Jafar Al-Gharaibeh [Mon, 13 Mar 2023 14:01:30 +0000 (09:01 -0500)]
debian, redhat: updating changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
18 months agoMerge pull request #12980 from FRRouting/mergify/bp/stable/8.5/pr-12974
Donatas Abraitis [Mon, 13 Mar 2023 05:11:48 +0000 (07:11 +0200)]
Merge pull request #12980 from FRRouting/mergify/bp/stable/8.5/pr-12974

bgpd: Increment version number even when no data is sent (backport #12974)

18 months agobgpd: Increment version number even when no data is sent
Donald Sharp [Sat, 11 Mar 2023 17:05:44 +0000 (12:05 -0500)]
bgpd: Increment version number even when no data is sent

When an update group decides to not send a prefix
announcement because it has not changed, still increment
the version number.  Why?  To allow for the situation
where you have say 2 peers in 1 peer group and shortly
after they come up a 3rd peer comes up.  It will be
placed into a separate update group and could be
coalesced down, when it finishes updating all data
to it.  Now imagine that a single prefix changes at
this point in time as well.  Then first 2 peers may
decide to not send the data, since nothing has changed.
While the 3rd peer will and since the versions numbers
never match they will never coalesce.  So when the decision
is made to skip, update the version number as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit a8038460bd2b413a0c082fbd629cdae00708b133)

18 months agoMerge pull request #12973 from FRRouting/mergify/bp/stable/8.5/pr-12962
Donatas Abraitis [Sat, 11 Mar 2023 07:38:20 +0000 (09:38 +0200)]
Merge pull request #12973 from FRRouting/mergify/bp/stable/8.5/pr-12962

bgpd: Check if the peer is configured as interface when checking NHT (backport #12962)

18 months agotests: Check if IPv6 BGP Link-Local peering works
Donatas Abraitis [Tue, 7 Mar 2023 20:41:58 +0000 (22:41 +0200)]
tests: Check if IPv6 BGP Link-Local peering works

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0f4a09ac25d42601f42d37e044f8630ec7d31507)

18 months agobgpd: Check if the peer is configured as interface when checking NHT
Donatas Abraitis [Tue, 7 Mar 2023 20:36:15 +0000 (22:36 +0200)]
bgpd: Check if the peer is configured as interface when checking NHT

This causes early return. peer->conf is NULL for IPv6 link-local peering,
and the session never establish.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e9ad26e53f0b307d73da6f3083851054a5734ce9)

18 months agoMerge pull request #12956 from FRRouting/mergify/bp/dev/8.5/pr-12951
Donatas Abraitis [Mon, 6 Mar 2023 06:53:57 +0000 (08:53 +0200)]
Merge pull request #12956 from FRRouting/mergify/bp/dev/8.5/pr-12951

bgpd: Fix use beyond end of stream of labeled unicast parsing (backport #12951)

18 months agobgpd: Fix use beyond end of stream of labeled unicast parsing
Donald Sharp [Sat, 4 Mar 2023 02:58:33 +0000 (21:58 -0500)]
bgpd: Fix use beyond end of stream of labeled unicast parsing

Fixes a couple crashes associated with attempting to read
beyond the end of the stream.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7404a914b0cafe046703c8381903a80d3def8f8b)

18 months agoMerge pull request #12952 from FRRouting/mergify/bp/dev/8.5/pr-12950
Donatas Abraitis [Sun, 5 Mar 2023 18:49:09 +0000 (20:49 +0200)]
Merge pull request #12952 from FRRouting/mergify/bp/dev/8.5/pr-12950

babeld: fix #11808 to avoid infinite loops (backport #12950)

18 months agobabeld: fix #11808 to avoid infinite loops
harryreps [Fri, 3 Mar 2023 23:17:14 +0000 (23:17 +0000)]
babeld: fix #11808 to avoid infinite loops

Replacing continue in loops to goto done so that index of packet buffer
increases.

Signed-off-by: harryreps <harryreps@gmail.com>
(cherry picked from commit ae1e0e1fed77716bc06f181ad68c4433fb5523d0)

18 months agoMerge pull request #12927 from FRRouting/mergify/bp/dev/8.5/pr-12903
Donatas Abraitis [Thu, 2 Mar 2023 10:41:30 +0000 (12:41 +0200)]
Merge pull request #12927 from FRRouting/mergify/bp/dev/8.5/pr-12903

pimd, pim6d: Don't track nexthop for RP 0.0.0.0 & 0::0 (backport #12903)

18 months agoMerge pull request #12926 from FRRouting/mergify/bp/dev/8.5/pr-12921
Donatas Abraitis [Thu, 2 Mar 2023 09:21:04 +0000 (11:21 +0200)]
Merge pull request #12926 from FRRouting/mergify/bp/dev/8.5/pr-12921

pimd: Prevent crash when pimreg already exists. (backport #12921)

18 months agoMerge pull request #12925 from FRRouting/mergify/bp/dev/8.5/pr-12008
Donatas Abraitis [Thu, 2 Mar 2023 08:36:37 +0000 (10:36 +0200)]
Merge pull request #12925 from FRRouting/mergify/bp/dev/8.5/pr-12008

pimd, pim6d: Fix RPF check (backport #12008)

18 months agopimd, pim6d: Don't track nexthop for RP 0.0.0.0 & 0::0
Sarita Patra [Sat, 25 Feb 2023 08:33:13 +0000 (00:33 -0800)]
pimd, pim6d: Don't track nexthop for RP 0.0.0.0 & 0::0

Topology:
========
FHR----Source

Problem:
=======
When FHR receives multicast traffic, there is no RP configured,
PIMD does NHT register for RP address 0.0.0.0 and group 224.0.0.0/4
PIM6D does NHT register for RP address 0::0 and group FF00::0/8

frr# show ip pim nexthop
Number of registered addresses: 1
Address         Interface        Nexthop
---------------------------------------------

frr# show ipv6 pim nexthop
Number of registered addresses: 1
Address         Interface        Nexthop
---------------------------------------------

Fix:
====
Dont track nexthop for RP 0.0.0.0 & 0::0.

frr# show ip pim nexthop
Number of registered addresses: 0

frr# show ipv6 pim nexthop
Number of registered addresses: 0

Issue: #12104

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 201a31b9773f1c7b091a07b38dd5cbb55e7bdeab)

18 months agopimd: Prevent crash when pimreg already exists.
Donald Sharp [Wed, 1 Mar 2023 19:41:21 +0000 (14:41 -0500)]
pimd: Prevent crash when pimreg already exists.

If the pimreg device exists but it has not been set to the pim->pimreg pointer we can have
a crash.  Just prevent the crash since it's some sort of startup / re-org the network
issue.

(gdb) bt
0  0x00007f0485b035cb in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007f0485c0fbec in core_handler (signo=6, siginfo=0x7ffdc0198030, context=<optimized out>) at lib/sigevent.c:264
2  <signal handler called>
3  0x00007f04859668eb in raise () from /lib/x86_64-linux-gnu/libc.so.6
4  0x00007f0485951535 in abort () from /lib/x86_64-linux-gnu/libc.so.6
5  0x00007f0485c3af76 in _zlog_assert_failed (xref=xref@entry=0x55692269b940 <_xref.23164>, extra=extra@entry=0x0) at lib/zlog.c:680
6  0x00005569226150d0 in pim_if_new (ifp=0x556922c82900, gm=gm@entry=false, pim=pim@entry=false, ispimreg=ispimreg@entry=true,
    is_vxlan_term=is_vxlan_term@entry=false) at pimd/pim_iface.c:124
7  0x0000556922615140 in pim_if_create_pimreg (pim=pim@entry=0x556922cc11e0) at pimd/pim_iface.c:1549
8  0x0000556922616bc8 in pim_if_create_pimreg (pim=0x556922cc11e0) at pimd/pim_iface.c:1613
9  pim_ifp_create (ifp=0x556922cc0e70) at pimd/pim_iface.c:1641
10 0x00007f0485c32cf9 in zclient_interface_add (cmd=<optimized out>, zclient=<optimized out>, length=<optimized out>, vrf_id=77) at lib/zclient.c:2214
11 0x00007f0485c3346a in zclient_read (thread=<optimized out>) at lib/zclient.c:4003
12 0x00007f0485c215ed in thread_call (thread=thread@entry=0x7ffdc0198880) at lib/thread.c:2008
13 0x00007f0485bdbbc8 in frr_run (master=0x556922a10470) at lib/libfrr.c:1223
14 0x000055692260312b in main (argc=<optimized out>, argv=0x7ffdc0198b98, envp=<optimized out>) at pimd/pim_main.c:176

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7ae7a3bfd6043bcb0124c730cd04b9a37a2df21e)

18 months agopimd, pim6d: Fix join prune handling
Sarita Patra [Fri, 24 Feb 2023 10:03:34 +0000 (02:03 -0800)]
pimd, pim6d: Fix join prune handling

When upstream RPF address is secondary address, and
neighborship is built with primary address,
then pim_neighbor_find() fails.

Verify the upstream  RPF address is present in the
neighbor primary and secondary address list.

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit d77da853f0f055244f5442e37b690809ab951a5a)

18 months agopimd, pim6d: Fix pim upstream rpf change
Sarita Patra [Wed, 19 Oct 2022 00:32:11 +0000 (17:32 -0700)]
pimd, pim6d: Fix pim upstream rpf change

When upstream RPF address is secondary, and
neighborship is built with primary address,
then pim_neighbor_find() fails, due to which when there
is upstream change it wont send prune.

Verify the nexthop is present in the neighbor primary
and secondary address list.

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 689b9f10fc33387414c8077cd8cacd2eb2fc7198)

18 months agopimd, pim6d: fix pim neighbor check in pim_nexthop_lookup
Sarita Patra [Tue, 18 Oct 2022 23:31:00 +0000 (16:31 -0700)]
pimd, pim6d: fix pim neighbor check in pim_nexthop_lookup

When there is a mismatch in nexthop address (secondary address)
and neighborship address(primary address) on the same interface,
RPF check fails.

This is fixed now.

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit e14ba248742cd56b903ccd965576ac18ad41d310)

18 months agopimd, pim6d: Fix RP Unknown IIF
Sarita Patra [Tue, 18 Oct 2022 23:27:14 +0000 (16:27 -0700)]
pimd, pim6d: Fix RP Unknown IIF

When route to RP is having nexthop secndary address,
neighborship is built with primary address,
then pim_neighbor_find() fails, which causes RP IIF
Unknown.

Fix:
Verify pim neighborship on the RP connected interface.

Issue: #11526

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit ae5bcac0aee80d99d2fd2adba75733d86d36226f)

18 months agopimd, pim6d: Fix BSM packet process
Sarita Patra [Tue, 18 Oct 2022 23:06:12 +0000 (16:06 -0700)]
pimd, pim6d: Fix BSM packet process

Problem 1:
When route to BSR is having nexthop secondary address,
neighborship is built with primary address,
then pim_neighbor_find() fails, which cause drop of BSM
packet.

Fix 1:
Verify pim neighborship on the BSM received interface.
Problem 2:

Problem 2:
Source IP BSM address is primary address, where
as nexthop also can be primary or secondary address.

Fix 2:
Avoiding the check (nhaddr == src_ip) for PIMV6

Issue: #11957

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 2c6a32f9be3c687fe5c52d055f21912da8364ec6)

18 months agopimd,pim6d: Modify pim_neighbor_find() API
Sarita Patra [Mon, 23 Jan 2023 05:10:45 +0000 (21:10 -0800)]
pimd,pim6d: Modify pim_neighbor_find() API

Modify pim_neighbor_find() API to find the neighbor
in neighbor secondary list.

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 3dbf370ac0a7cb0f10c56c37286adf971215dff1)

18 months agozebra: Send nexthop ifindex for type NEXTHOP_TYPE_IPV6
Sarita Patra [Mon, 10 Oct 2022 18:06:10 +0000 (11:06 -0700)]
zebra: Send nexthop ifindex for type NEXTHOP_TYPE_IPV6

Once RP/BSR address is learned in PIMD, PIMD does nexthop tracking
in Zebra.
For IPV6 address, the nexthop type is either NEXTHOP_TYPE_IPV6
or NEXTHOP_TYPE_IPV6_IFINDEX.
Zebra should send nexthop ifindex information along with nexthop address
to the client (PIMD).

Issue: #11526
Issue: #11957

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit ed9323604af55590d81900af2d6953c9db565ab3)

18 months agoMerge pull request #12910 from FRRouting/mergify/bp/dev/8.5/pr-12899
Donatas Abraitis [Tue, 28 Feb 2023 08:26:14 +0000 (10:26 +0200)]
Merge pull request #12910 from FRRouting/mergify/bp/dev/8.5/pr-12899

pim6d: Fix display issue in "show ipv6 mld interface" command (backport #12899)

18 months agoMerge pull request #12909 from FRRouting/mergify/bp/dev/8.5/pr-12906
Donatas Abraitis [Mon, 27 Feb 2023 21:30:42 +0000 (23:30 +0200)]
Merge pull request #12909 from FRRouting/mergify/bp/dev/8.5/pr-12906

pimd, pim6d: Upstream IIF pointing towards PIM and IGMP disabled source conn… (backport #12906)

19 months agopim6d: Fix missing parameters in "show ipv6 mld interface" command
Sarita Patra [Fri, 24 Feb 2023 15:13:30 +0000 (07:13 -0800)]
pim6d: Fix missing parameters in "show ipv6 mld interface" command

Before fix:
==========
frr# show ipv6 mld interface
Interface         State  V  Querier                    Timer               Uptime
ens224            up     1  fe80::250:56ff:feb7:a7e3   query 00:00:24.219  00:00:07.031

After fix:
=========
frr(config-if)# do show ipv6 mld interface
 Interface  State  Address                   V  Querier  QuerierIp                 Query Timer   Uptime
 ens224     up     fe80::250:56ff:feb7:a7e3  1  local    fe80::250:56ff:feb7:a7e3  00:01:22.263  00:08:00.237

Issue: #11241

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit cbb1e51311ca710540d752c9d6c7689f8fc65dc4)

19 months agopim6d: Display primary address in "show ipv6 mld interface json" cmd
Sarita Patra [Fri, 24 Feb 2023 15:11:57 +0000 (07:11 -0800)]
pim6d: Display primary address in "show ipv6 mld interface json" cmd

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 3ab119a4bb79c46c8cce99c8a6ee860c43e378dd)

19 months agopim6d: Don't display MLD disabled or down interfaces in "show ipv6 mld interface...
Sarita Patra [Fri, 24 Feb 2023 15:01:22 +0000 (07:01 -0800)]
pim6d: Don't display MLD disabled or down interfaces in "show ipv6 mld interface" cmd

We should not display down interfaces or MLD disabled interfaces in
"show ipv6 mld interface" command.

Before fix:
==========
frr# show ipv6 mld interface
Interface         State  V  Querier                    Timer               Uptime
ens192            up     2  fe80::250:56ff:feb7:d04    query 00:00:25.432  00:00:07.038
ens224            up     1  fe80::250:56ff:feb7:a7e3   query 00:00:24.219  00:00:07.031
pim6reg            down

After fix:
=========
frr# show ipv6 mld interface
Interface         State  V  Querier                    Timer               Uptime
ens192            up     2  fe80::250:56ff:feb7:d04    query 00:00:25.432  00:00:07.038
ens224            up     1  fe80::250:56ff:feb7:a7e3   query 00:00:24.219  00:00:07.031

Issue: #11241

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit fe4db62c3dbc7a2ab1b27ae879bf0a76dcfe5b4d)

19 months agopimd, pim6d: Upstream IIF pointing towards PIM and IGMP disabled source connected...
Sarita Patra [Mon, 27 Feb 2023 06:25:05 +0000 (22:25 -0800)]
pimd, pim6d: Upstream IIF pointing towards PIM and IGMP disabled source connected interface

Topology:
=========
RP---FHR<ens224>---Source

Problem Statement:
=================
Step 1:
Enable PIM and IGMP on source connected interface ens224

Step 2:
Start multicast traffic. (s,g) mroute and upstream will be created as expected.

dev# show ip mroute
IP Multicast Routing Table
Flags: S - Sparse, C - Connected, P - Pruned
       R - SGRpt Pruned, F - Register flag, T - SPT-bit for SSM FHR
 Source    Group      Flags  Proto  Input   Output  TTL  Uptime
 50.0.0.4  225.1.1.1  SF     PIM    ens224  pimreg  1    00:37:55

dev# show ip pim upstream
 Iif     Source    Group      State      Uptime    JoinTimer  RSTimer   KATimer   RefCnt
 ens224  50.0.0.4  225.1.1.1  NotJ,RegJ  00:37:57  --:--:--   --:--:--  00:02:43  1

Step 3:
Disable PIM on source connected interafce ens224

dev# show ip mroute
IP Multicast Routing Table
Flags: S - Sparse, C - Connected, P - Pruned
       R - SGRpt Pruned, F - Register flag, T - SPT-bit for SSM FHR
 Source    Group      Flags  Proto  Input   Output  TTL  Uptime
 50.0.0.4  225.1.1.1  SF     PIM    ens224  pimreg  1    00:38:05

dev# show ip pim upstream
 Iif     Source    Group      State      Uptime    JoinTimer  RSTimer   KATimer   RefCnt
 ens224  50.0.0.4  225.1.1.1  NotJ,RegJ  00:38:08  --:--:--   --:--:--  00:02:32  1

Step 4:
Disable IGMP on source connected interface ens224

dev# show ip pim upstream
 Iif     Source    Group      State      Uptime    JoinTimer  RSTimer   KATimer   RefCnt
 ens224  50.0.0.4  225.1.1.1  NotJ,RegJ  00:38:15  --:--:--   --:--:--  00:03:27  1

dev# show ip mroute
IP Multicast Routing Table
Flags: S - Sparse, C - Connected, P - Pruned
       R - SGRpt Pruned, F - Register flag, T - SPT-bit for SSM FHR
 Source    Group      Flags  Proto  Input   Output  TTL  Uptime
 50.0.0.4  225.1.1.1  SF     PIM    <iif?>  pimreg  1    00:38:18

Pim upstream IIF is still pointing towards the source connected
interface which is not pim enabled and not IGMP enabled and
Mroute is still present in the kernel and KAT timer is still running
on the interface, where ifp->info is already set to NULL.
This leads to crash.

Root Cause:
==========
When "no ip pim" commands get executed on source connected interface,
we are updating upstream IIF only when IGMP is not enabled on the same
interface.

Fix:
===
When PIM is disabled on source connected interface, update upstream IIF
no matter if IGMP is enabled or not on the same interface.

Issue: #12848
Issue: #10782

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 9e01548593d1b8a612eacf49bdcf690d2860d941)

19 months agoMerge pull request #12898 from FRRouting/mergify/bp/dev/8.5/pr-12888
Donald Sharp [Mon, 27 Feb 2023 18:40:06 +0000 (13:40 -0500)]
Merge pull request #12898 from FRRouting/mergify/bp/dev/8.5/pr-12888

bgpd: Flags fixes (backport #12888)

19 months agotests: Increase flags from uint32_t to uint64_t
Donatas Abraitis [Fri, 27 Jan 2023 11:49:16 +0000 (13:49 +0200)]
tests: Increase flags from uint32_t to uint64_t

Missed this part when increasing in the past.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agotests: Cover all enum values for unit tests
Donatas Abraitis [Mon, 20 Feb 2023 15:59:09 +0000 (17:59 +0200)]
tests: Cover all enum values for unit tests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12902 from FRRouting/mergify/bp/dev/8.5/pr-12900
Donatas Abraitis [Sun, 26 Feb 2023 12:22:02 +0000 (14:22 +0200)]
Merge pull request #12902 from FRRouting/mergify/bp/dev/8.5/pr-12900

bgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED (backport #12900)

19 months agobgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED
Donatas Abraitis [Fri, 24 Feb 2023 20:01:15 +0000 (22:01 +0200)]
bgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED

Just was blind when not seing it's already dup'ed above:

``` if (peer->sort == BGP_PEER_EBGP
    && (!CHECK_FLAG(peer->af_flags[afi][safi],
    PEER_FLAG_AS_PATH_UNCHANGED)
|| attr->aspath->segments == NULL)
    && (!CHECK_FLAG(peer->af_flags[afi][safi],
    PEER_FLAG_RSERVER_CLIENT))) {
aspath = aspath_dup(attr->aspath); <<<<<<<<<<<<<<<
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9930441c66131d26fd7c51d9684b9e6a228c38d7)

19 months agotests: Check if peer->af_flags can be higher than uint32_t
Donatas Abraitis [Thu, 23 Feb 2023 21:10:26 +0000 (23:10 +0200)]
tests: Check if peer->af_flags can be higher than uint32_t

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 5acfd822be556d2123cf8c0c9d36aa20a48b3329)

19 months agobgpd: Renumber peer->af_flags to be without any gaps
Donatas Abraitis [Thu, 23 Feb 2023 21:51:10 +0000 (23:51 +0200)]
bgpd: Renumber peer->af_flags to be without any gaps

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 47017b846f93bb17abee61262eeb02ca6ab570f5)

19 months agobgpd: Convert missing uint32_t to uint64_t for for af_flags/flags
Donatas Abraitis [Thu, 23 Feb 2023 21:02:35 +0000 (23:02 +0200)]
bgpd: Convert missing uint32_t to uint64_t for for af_flags/flags

It was hard to catch those unless using higher values than uint32_t, but
already hit, it's time to fix completely.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit d782e3ffa24832b05aec2871332a3a8523ab3e97)

19 months agobgpd: Convert peer_af_flag_check() to bool
Donatas Abraitis [Thu, 23 Feb 2023 20:54:12 +0000 (22:54 +0200)]
bgpd: Convert peer_af_flag_check() to bool

Since we increased peer->af_flags from uint32_t to uint64_t,
peer_af_flag_check() was historically returning integer, and not bool
as should be.

The bug was that if we have af_flags higher than uint32_t it will never
returned a right value.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 2c722516c3b8cf3fe63853ed8cae2d518ec62f59)

19 months agoMerge pull request #12891 from FRRouting/mergify/bp/dev/8.5/pr-12884
Donatas Abraitis [Fri, 24 Feb 2023 13:42:10 +0000 (15:42 +0200)]
Merge pull request #12891 from FRRouting/mergify/bp/dev/8.5/pr-12884

bgpd: Flowspec overflow issue (backport #12884)

19 months agoMerge pull request #12896 from FRRouting/mergify/bp/dev/8.5/pr-12885
Donatas Abraitis [Fri, 24 Feb 2023 13:16:12 +0000 (15:16 +0200)]
Merge pull request #12896 from FRRouting/mergify/bp/dev/8.5/pr-12885

lib, bgpd: bmp was not specifying l2vpn afi (backport #12885)

19 months agoMerge pull request #12883 from FRRouting/mergify/bp/dev/8.5/pr-12878
Donatas Abraitis [Fri, 24 Feb 2023 09:40:13 +0000 (11:40 +0200)]
Merge pull request #12883 from FRRouting/mergify/bp/dev/8.5/pr-12878

pimd: bughunting improvements (backport #12878)

19 months agolib, bgpd: bmp was not specifying l2vpn afi
Donald Sharp [Thu, 23 Feb 2023 19:22:33 +0000 (14:22 -0500)]
lib, bgpd: bmp was not specifying l2vpn afi

The l2vpn afi was not being properly displayed
when a show run was being issued.  Add a
afi2str_lower function and use it.

Fixes: #12867
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 0884f1644b19dd6e70a48a6c29fd5d201b264d6d)

19 months agobgpd: Flowspec overflow issue
Donald Sharp [Thu, 23 Feb 2023 18:29:32 +0000 (13:29 -0500)]
bgpd: Flowspec overflow issue

According to the flowspec RFC 8955 a flowspec nlri is <length, <nlri data>>
Specifying 0 as a length makes BGP get all warm on the inside.  Which
in this case is not a good thing at all.  Prevent warmth, stay cold
on the inside.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 0b999c886e241c52bd1f7ef0066700e4b618ebb3)

19 months agoMerge pull request #12886 from FRRouting/mergify/bp/dev/8.5/pr-12876
Christian Hopps [Fri, 24 Feb 2023 07:51:57 +0000 (02:51 -0500)]
Merge pull request #12886 from FRRouting/mergify/bp/dev/8.5/pr-12876

bgpd: Align `show bgp ...` output with the header for wide option (backport #12876)

19 months agobgpd: Align `show bgp ...` output with the header for wide option
Donatas Abraitis [Wed, 22 Feb 2023 20:22:28 +0000 (22:22 +0200)]
bgpd: Align `show bgp ...` output with the header for wide option

Before:

```
r1# sh ip bgp wide
BGP table version is 1, local router ID is 192.168.2.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network                                      Next Hop                                  Metric LocPrf Weight Path
 *  172.16.255.254/32                            192.168.2.2                                    0             0 (65003) i
 *>                                              192.168.1.2                                    0             0 (65002) i

Displayed  1 routes and 2 total paths
r1#
```

After:

```
r1# sh ip bgp wide
BGP table version is 1, local router ID is 192.168.2.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network                                      Next Hop                                  Metric LocPrf Weight Path
 *  172.16.255.254/32                            192.168.2.2                                    0             0 (65003) i
 *>                                              192.168.1.2                                    0             0 (65002) i

Displayed  1 routes and 2 total paths
r1#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit fccd7e53db0f434111115a1a8bd96d008abc0662)

19 months agopimd: try to reinstall MFC when we get NOCACHE
David Lamparter [Wed, 1 Jun 2022 07:54:31 +0000 (09:54 +0200)]
pimd: try to reinstall MFC when we get NOCACHE

Whether due to a pimd bug, some expiry, or someone just deleting MFC
entries, when we're in NOCACHE we *know* there's no MFC entry.  Add an
install call to make sure pimd's MFC view aligns with the actual kernel
MFC.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agopimd: make logs useful for input drops
David Lamparter [Thu, 10 Mar 2022 12:59:26 +0000 (13:59 +0100)]
pimd: make logs useful for input drops

This path here is pretty far on top of the list of issues that operators
will run into and have to debug when setting up PIM.  Make the log
messages actually tell what's going on.  Also escalate some from
`debug mroute detail` to `debug mroute`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agoMerge pull request #12877 from FRRouting/mergify/bp/dev/8.5/pr-12869
Jafar Al-Gharaibeh [Thu, 23 Feb 2023 04:50:23 +0000 (22:50 -0600)]
Merge pull request #12877 from FRRouting/mergify/bp/dev/8.5/pr-12869

bgpd: Give better debug message when configuration is being read in (backport #12869)

19 months agoMerge pull request #12875 from FRRouting/mergify/bp/dev/8.5/pr-12865
Jafar Al-Gharaibeh [Thu, 23 Feb 2023 04:49:56 +0000 (22:49 -0600)]
Merge pull request #12875 from FRRouting/mergify/bp/dev/8.5/pr-12865

bgpd: free rfapi callback object always (backport #12865)

19 months agoMerge pull request #12873 from FRRouting/mergify/bp/dev/8.5/pr-12861
Donatas Abraitis [Wed, 22 Feb 2023 20:55:17 +0000 (22:55 +0200)]
Merge pull request #12873 from FRRouting/mergify/bp/dev/8.5/pr-12861

bgpd: Confederation fixes with remote-as external/internal (backport #12861)

19 months agobgpd: Give better debug message when configuration is being read in
Donald Sharp [Wed, 22 Feb 2023 16:38:00 +0000 (11:38 -0500)]
bgpd: Give better debug message when configuration is being read in

Sometimes bgp connections can be rejected for a variety of reasons.  Give
a bit more context about what is going wrong so that the operator can
make better decisions about their network.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7c5062fb275c0530559004621f7cc7e2f5d926a4)

19 months agoMerge pull request #12871 from FRRouting/mergify/bp/dev/8.5/pr-12850
Donatas Abraitis [Wed, 22 Feb 2023 20:28:18 +0000 (22:28 +0200)]
Merge pull request #12871 from FRRouting/mergify/bp/dev/8.5/pr-12850

ospfd client api bugfix and refinements (backport #12850)

19 months agobgpd: free rfapi callback object always
Mark Stapp [Wed, 22 Feb 2023 13:58:28 +0000 (08:58 -0500)]
bgpd: free rfapi callback object always

An rfapi timer callback is responsible for the memory in a
context object, even in special-case exit paths. Always
free that object.

Signed-off-by: Mark Stapp <mjs@labn.net>
(cherry picked from commit 870d3d2cb8e2fa6ff9329ec7126265d1e25a38ae)

19 months agotests: Check if BGP confederation works with AS_EXTERNAL (!AS_SPECIFIED)
Donatas Abraitis [Tue, 21 Feb 2023 21:37:04 +0000 (23:37 +0200)]
tests: Check if BGP confederation works with AS_EXTERNAL (!AS_SPECIFIED)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit caf65e4a27539b1ecc0f6820994d36278c0e63e6)

19 months agobgpd: Pass global ASN for confederation peers if not AS_SPECIFIED
Donatas Abraitis [Tue, 21 Feb 2023 21:10:45 +0000 (23:10 +0200)]
bgpd: Pass global ASN for confederation peers if not AS_SPECIFIED

When we specify remote-as as external/internal, we need to set local_as to
bgp->as, instead of bgp->confed_id. Before this patch, (bgp->as != *as) is
always valid for such a case because *as is always 0.

Also, append peer->local_as as CONFED_SEQ to avoid other side withdrawing
the routes due to confederation own AS received and/or malformed as-path.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit db5a5ee6e4665b5f951ed2a37398820da4b762f1)

19 months agotests: improve the ospfapi test (move to square topology)
Christian Hopps [Sun, 6 Feb 2022 14:41:12 +0000 (09:41 -0500)]
tests: improve the ospfapi test (move to square topology)

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 663a0c96d9c52895189bef7579a308a1b14120fa)

19 months agoospfclient: remove register "READY" requirement
Christian Hopps [Sun, 20 Feb 2022 08:59:41 +0000 (03:59 -0500)]
ospfclient: remove register "READY" requirement

- also add ability of the apibin to process commands on stdin

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 6efa8fd5c1653372cea1b25a9fa764269960bb91)

19 months agoospfclient: bugfix and no implicit register
Christian Hopps [Sun, 19 Feb 2023 23:55:58 +0000 (18:55 -0500)]
ospfclient: bugfix and no implicit register

- dont delete the callback on opaque data delete
- require explicit registration

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 703d2c0a3e30c18acd2426b50f97ea8c91c479f9)

19 months agoospfd: compare prefix values in host order
Christian Hopps [Sun, 6 Feb 2022 20:01:28 +0000 (15:01 -0500)]
ospfd: compare prefix values in host order

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 156a904cae87a1ea1cd51de5012c9bddc0d63747)

19 months agoospfd: small bugfix for miscounting A[S]BRs
Christian Hopps [Sun, 6 Feb 2022 14:40:24 +0000 (09:40 -0500)]
ospfd: small bugfix for miscounting A[S]BRs

- improve the debug for the second add router call.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 1eea62bb1c439ee66d502ef808695554370032e7)

19 months agoospfd: inc. opaque data in `show opaque info detail json` output
Christian Hopps [Sat, 18 Feb 2023 17:16:18 +0000 (12:16 -0500)]
ospfd: inc. opaque data in `show opaque info detail json` output

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 1794afe01030b3111e83e26986cd004dce290049)

19 months agoMerge pull request #12856 from FRRouting/mergify/bp/dev/8.5/pr-12795
Donatas Abraitis [Wed, 22 Feb 2023 08:57:40 +0000 (10:57 +0200)]
Merge pull request #12856 from FRRouting/mergify/bp/dev/8.5/pr-12795

Vpnv6 nexthop encoding (backport #12795)

19 months agoMerge pull request #12859 from FRRouting/mergify/bp/dev/8.5/pr-12818
Donatas Abraitis [Tue, 21 Feb 2023 19:18:04 +0000 (21:18 +0200)]
Merge pull request #12859 from FRRouting/mergify/bp/dev/8.5/pr-12818

zebra: Fix other table inactive when ip import-table is on (backport #12818)

19 months agozebra: Fix other table inactive when ip import-table is on
zyxwvu Shi [Wed, 15 Feb 2023 15:55:00 +0000 (23:55 +0800)]
zebra: Fix other table inactive when ip import-table is on

In `rib_link`, if is_zebra_import_table_enabled returns
true, `rib_queue_add` will not called, resulting in other
table route node never processed. This actually should not
be dependent on whether the route is imported.

In `rib_delnode`, if is_zebra_import_table_enabled returns
true, it will use `rib_unlink` instead of enqueuing the
route node for process. There is no reason that imported
route nodes should not be reprocessed. Long ago, the
behaviour was dependent on whether the route_entry comes
from a table other than main.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
(cherry picked from commit 207207c0c03e1108d1bae5cf345b7a29850e6ffd)

19 months agobgpd: clarify when the vpnv6 nexthop length must be modified
Philippe Guibert [Mon, 13 Feb 2023 11:18:33 +0000 (12:18 +0100)]
bgpd: clarify when the vpnv6 nexthop length must be modified

Using a route-map to update the local ipv6 address has to be
better clarified. Actually, when a VPN SAFI is used, the nexthop
length must be changed to 48 bytes. Other cases, the length will
be 32 bytes.

Fixes: 9795e9f23465 ("bgpd: fix when route-map changes the link local
nexthop for vpnv6")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 5bbcc78202f53f67082aa0d3026a8b7e8c44909a)

19 months agobgpd: factorise ipv6 vpn nexthop encoding
Philippe Guibert [Mon, 13 Feb 2023 11:17:28 +0000 (12:17 +0100)]
bgpd: factorise ipv6 vpn nexthop encoding

Because mp_nexthop_len attribute value stands for the length
to encode in the stream, simplify the way the nexthop is
forged.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 558e8f58012a2f5473e72d70dc74ab7749443dc4)

19 months agoMerge pull request #12826 from FRRouting/mergify/bp/dev/8.5/pr-12817
Donatas Abraitis [Fri, 17 Feb 2023 12:27:56 +0000 (14:27 +0200)]
Merge pull request #12826 from FRRouting/mergify/bp/dev/8.5/pr-12817

some missed upstream commits (backport #12817)

19 months agoMerge pull request #12828 from FRRouting/mergify/bp/dev/8.5/pr-12734
Igor Ryzhov [Fri, 17 Feb 2023 10:10:18 +0000 (12:10 +0200)]
Merge pull request #12828 from FRRouting/mergify/bp/dev/8.5/pr-12734

lib: Fix non-use of option (backport #12734)

19 months agolib: Fix non-use of option
Donald Sharp [Thu, 2 Feb 2023 21:28:27 +0000 (16:28 -0500)]
lib: Fix non-use of option

Commit d7c6467ba2f55d1055babbb7fe82716ca3efdc7e added the
ability to specify non pretty printing but unfortunately
forgot to use the option variable to make the whole
thing work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 00b0bb99ae9fb6cd003d3e38c4760d1fd59ab545)

19 months agozebra: Add debug for bridge capability
vivek [Tue, 13 Apr 2021 19:12:40 +0000 (12:12 -0700)]
zebra: Add debug for bridge capability

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Ticket: #2609944
(cherry picked from commit f88889ba7a48c6126e7f389b023cd232cdee5078)

19 months agobgpd: Prevent multipathing among EVPN and non-EVPN paths
vivek [Fri, 18 Dec 2020 18:55:40 +0000 (10:55 -0800)]
bgpd: Prevent multipathing among EVPN and non-EVPN paths

Ensure that a multipath set is fully comprised of EVPN paths (i.e.,
paths imported into the VRF from EVPN address-family) or non-EVPN
paths. This is actually a condition that existed already in the code
but was not properly enforced.

This change, as a side effect, eliminates the known trigger condition
for bad or missing RMAC programming in an EVPN deployment, described
in tickets CM-29043 and CM-31222. Routes (actually, paths) in a VRF
routing table that require VXLAN tunneling to the next hop currently
need some special handling in zebra to deal with the nexthop (neigh)
and RMAC programming, and this is implemented for the entire route
(prefix), not per-path. This can lead to the bad or missing RMAC
situation, which is now eliminated by ensuring all paths in the route
are 'similar'.

The longer-term solution in CL 5.x will be to deal with the special
programming by means of explicit communication between bgpd and zebra.
This is already implemented for EVPN-MH via CM-31398. These changes
will be extended to non-MH also and the special code in zebra removed
or refined.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Acked-by: Trey Aspelund <taspelund@nvidia.com>
Acked-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Acked-by: Chirag Shah <chirag@nvidia.com>
Ticket: CM-29043
Testing Done:
1. Manual testing
2. precommit on both MLX and BCM platforms
3. evpn-smoke - BCM and VX

Results described in the ticket

(cherry picked from commit d2d71b042edc628cb6edae0b25d0a49aa9ad2050)

19 months agobgpd: Fix deterministic-med check for stale paths
vivek [Thu, 3 Dec 2020 04:04:19 +0000 (20:04 -0800)]
bgpd: Fix deterministic-med check for stale paths

When performing deterministic MED processing, ensure that the peer
status is not checked when we encounter a stale path. Otherwise, this
path will be skipped from the DMED consideration leading to it potentially
not being installed.

Test scenario: Consider a prefix with 2 (multi)paths. The peer that
announces the path with the winning DMED undergoes a graceful-restart.
Before it comes back up, the other path goes away. Prior to the fix, a
third router that receives both these paths would have ended up not
having any path installed to the prefix after the above events.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
For internal use:
Ticket: CM-32032
Testing done: Multiple manual testing

(cherry picked from commit de692a4ebe0b8ea8e191d8ac1f3b41a386edd577)

19 months agoMerge pull request #12803 from FRRouting/mergify/bp/dev/8.5/pr-12790
Donald Sharp [Tue, 14 Feb 2023 20:19:28 +0000 (15:19 -0500)]
Merge pull request #12803 from FRRouting/mergify/bp/dev/8.5/pr-12790

vrrpd: give null when using null ifp to lookup vr (backport #12790)

19 months agovrrpd: give null when using null ifp to lookup vr
Quentin Young [Mon, 28 Oct 2019 15:41:38 +0000 (15:41 +0000)]
vrrpd: give null when using null ifp to lookup vr

This is still causing crashes somehow.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
(cherry picked from commit ed331629de425914568c1d5c114018878627cdaf)

19 months agoMerge pull request #12788 from FRRouting/mergify/bp/dev/8.5/pr-12776
Jafar Al-Gharaibeh [Fri, 10 Feb 2023 16:59:19 +0000 (10:59 -0600)]
Merge pull request #12788 from FRRouting/mergify/bp/dev/8.5/pr-12776

pim6d: Modify "show ipv6 mld join json" o/p (backport #12776)

19 months agopim6d: Modify "show ipv6 mld join json" o/p
Sarita Patra [Thu, 9 Feb 2023 07:38:18 +0000 (23:38 -0800)]
pim6d: Modify "show ipv6 mld join json" o/p

Currently "show ipv6 mld join json" o/p is
frr# show ipv6 mld joins json
{
  "default":{
    "ens192":{
      "ff02:2":{
        "::":{
          "state":"JOIN",
          "created":"00:01:50.595",
          "lastSeen":"00:00:38.403",
        }
      }
    }
  }
}

Here, I modified the o/p as below for better understanding.
frr# show ipv6 mld joins json
{
  "default":{
    "vrf":"default",
    "ens192":{
      "ff02::2":{
        "*":{
          "state":"JOIN",
          "created":"00:00:42.766",
          "lastSeen":"00:00:05.266"
        }
      }
    }
  }
}

Issue: #12755

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 58971e1574911fd5bd4f6385c2fa93c999e33604)

19 months agoMerge pull request #12784 from FRRouting/mergify/bp/dev/8.5/pr-12781
Donatas Abraitis [Fri, 10 Feb 2023 08:41:11 +0000 (10:41 +0200)]
Merge pull request #12784 from FRRouting/mergify/bp/dev/8.5/pr-12781

lib: Release memory of YANG translation module on error (backport #12781)

19 months agoMerge pull request #12786 from FRRouting/mergify/bp/dev/8.5/pr-12782
Donatas Abraitis [Fri, 10 Feb 2023 04:42:06 +0000 (06:42 +0200)]
Merge pull request #12786 from FRRouting/mergify/bp/dev/8.5/pr-12782

bgpd: Intern default-originate attributes to avoid use-after-free (backport #12782)

19 months agotests: Check if BGP default-originate withdraw works correctly
Donatas Abraitis [Thu, 9 Feb 2023 20:55:53 +0000 (22:55 +0200)]
tests: Check if BGP default-originate withdraw works correctly

And also do not crash when we do `clear ip bgp ...`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 35b7ce08a81cfa8b55bd5160008e36d83cb8b791)

19 months agobgpd: Intern default-originate attributes to avoid use-after-free
Donatas Abraitis [Thu, 9 Feb 2023 20:29:25 +0000 (22:29 +0200)]
bgpd: Intern default-originate attributes to avoid use-after-free

When we receive a default route from a peer and we originate default route
using `neighbor default-originate`, we do not track of struct attr we use,
and when we do `no neighbor default-originate` we withdraw our generated
default route, but we announce default-route from the peer.

After we do this, we unintern aspath (which was used for default-originate),
BUT it was used also for peer's default route we received.

And here we have a use-after-free crash, because bgp_process_main_one()
reaps old paths that are marked as BGP_PATH_REMOVED with aspath->refcnt > 0,
but here it's 0.

```
0 0x55c24bbcd022 in aspath_key_make bgpd/bgp_aspath.c:2070
1 0x55c24b8f1140 in attrhash_key_make bgpd/bgp_attr.c:777
2 0x7f52322e66c9 in hash_release lib/hash.c:220
3 0x55c24b8f6017 in bgp_attr_unintern bgpd/bgp_attr.c:1271
4 0x55c24ba0acaa in bgp_path_info_free_with_caller bgpd/bgp_route.c:283
5 0x55c24ba0a7de in bgp_path_info_unlock bgpd/bgp_route.c:309
6 0x55c24ba0af6d in bgp_path_info_reap bgpd/bgp_route.c:426
7 0x55c24ba17b9a in bgp_process_main_one bgpd/bgp_route.c:3333
8 0x55c24ba18a1d in bgp_process_wq bgpd/bgp_route.c:3425
9 0x7f52323c2cd5 in work_queue_run lib/workqueue.c:282
10 0x7f52323aab92 in thread_call lib/thread.c:2006
11 0x7f5232300dc7 in frr_run lib/libfrr.c:1198
12 0x55c24b8ea792 in main bgpd/bgp_main.c:520
13 0x7f5231c3a082 in __libc_start_main ../csu/libc-start.c:308
14 0x55c24b8ef0bd in _start (/usr/lib/frr/bgpd+0x2c90bd)
    ```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e9340ff429f5f1a255e89a50867a04a370cd56bb)

19 months agolib: Free dnode before returning if YANG translator model is already loaded
Donatas Abraitis [Thu, 9 Feb 2023 21:14:46 +0000 (23:14 +0200)]
lib: Free dnode before returning if YANG translator model is already loaded

Seems just a missed one because at `goto error` we release dnode.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ecf82aa41e76ecfbaf3f5762af1e90ebc9263721)

19 months agolib: Release memory of YANG translation module on error
Donatas Abraitis [Thu, 9 Feb 2023 15:59:11 +0000 (17:59 +0200)]
lib: Release memory of YANG translation module on error

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b9941b3fec21eca413c4ca9460a264eb9afb7e34)

19 months agoMerge pull request #12778 from FRRouting/mergify/bp/dev/8.5/pr-12773
Donatas Abraitis [Thu, 9 Feb 2023 13:19:28 +0000 (15:19 +0200)]
Merge pull request #12778 from FRRouting/mergify/bp/dev/8.5/pr-12773

pbrd: fix large tableids displayed as negative (backport #12773)