]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
21 months agodebian: build against libunwind
David Lamparter [Sat, 15 Jul 2023 15:45:05 +0000 (08:45 -0700)]
debian: build against libunwind

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
21 months agodebian: clean up outdated/useless READMEs
David Lamparter [Sat, 15 Jul 2023 15:36:14 +0000 (08:36 -0700)]
debian: clean up outdated/useless READMEs

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
21 months agodebian: start 8.5.2-1
David Lamparter [Sat, 15 Jul 2023 15:34:27 +0000 (08:34 -0700)]
debian: start 8.5.2-1

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
21 months agodebian: merge tag 'frr-8.5.2' into debian/master
David Lamparter [Sat, 15 Jul 2023 15:33:02 +0000 (08:33 -0700)]
debian: merge tag 'frr-8.5.2' into debian/master

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
21 months agodebian: 8.4.4-1 debian/frr-8.4.4-1
David Lamparter [Wed, 12 Jul 2023 12:29:10 +0000 (14:29 +0200)]
debian: 8.4.4-1

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
21 months agodebian: fill in changelog for 8.4.4-1
David Lamparter [Wed, 12 Jul 2023 12:09:06 +0000 (14:09 +0200)]
debian: fill in changelog for 8.4.4-1

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
21 months agodebian: start 8.4.4-1
David Lamparter [Wed, 12 Jul 2023 12:01:50 +0000 (14:01 +0200)]
debian: start 8.4.4-1

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
21 months agodebian: merge tag 'frr-8.4.4' into debian/master
David Lamparter [Wed, 12 Jul 2023 12:00:28 +0000 (14:00 +0200)]
debian: merge tag 'frr-8.4.4' into debian/master

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
22 months agoFRR Release 8.5.2 docker/8.5.2 frr-8.5.2
Jafar Al-Gharaibeh [Fri, 16 Jun 2023 04:47:44 +0000 (23:47 -0500)]
FRR Release 8.5.2

* Bug Fixes

bfdd
    Fix malformed session with vrf
    Remove redundant nb destroy callbacks

bgpd
    Ensure stream received has enough data
    Fix bgpd core when unintern attr
    Fix the json output of show bgp all json to be in a valid format
    Make sure aigp attribute is non-transitive
    Using no pretty json output for l2vpn-evpn routes

doc
    Add `neighbor aigp` command for bgp

lib
    Fix memory leak in in link state
    Fix vtysh core when handling questionmark
    Link state memory corruption

ospfd
    Fix interface param type update
    Fix memory leaks w/ `show ip ospf int x json` commands
    Ospf opaque lsa stale processing fix and topotests.
    Respect loopback's cost that is set and set loopback costs to 0

pim6d
    Fix crash in ipv6 pim command

pimd
    Pim not sending register packets after changing from non dr to dr

tests
    Adjust aigp metric numbers for ibgp setup

tools
    Fix list value remove in frr-reload

vtysh
    Give actual pam error messages

zebra
    Evpn handle del event for dup detected mac
    Fix dp_out_queued counter to actually reflect real life
    Fix evpn dup detected local mac del event
    Reduce creation and fix memory leak of frrscripting pointers
    Unlock the route node when sending route notifications

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
22 months agoFRR Release 8.4.4 frr-8.4.4
Jafar Al-Gharaibeh [Fri, 16 Jun 2023 04:31:44 +0000 (23:31 -0500)]
FRR Release 8.4.4

    This a convenience release/tag for house keeping. We currently don't plan to publish
    binary packages with this release.

    Changelog:

bfdd
    Fix malformed session with vrf
    Remove redundant nb destroy callbacks

bgpd
    Aggregate-address memory leak fix
    Bmp fix peer-up ports byte order
    Check 7 bytes for long-lived graceful-restart capability
    Conform bgp_packet.h with coding standards
    Copy the password from the previous peer on peer_xfer_config()
    Do not allow a `no router bgp xxx` when autoimport is happening
    Do not allow l3vni changes when shutting down
    Do not announce routes immediatelly on filter updates
    Ensure stream received has enough data
    Fix bgpd core when unintern attr
    Fix crash for `show bgp ... neighbor received-routes detail|prefix`
    Fix debug output for route-map names when using a unsuppress-map
    Fix ecommunity parsing for as4
    Fix for ain->attr corruption during path update
    Fix lcom->str string length to correctly cover aliases
    Increase buffer size used for dumping bgp to mrt files
    Limit flowspec to no attribute means a implicit withdrawal
    Make bgp_keepalives.c not use mtype_tmp
    Prevent null pointer deref when outputting data
    Treat withdraw variable as a bool
    Use interface name instead of pointer value
    Use the actual pointer type instead of a void

lib
    Adjust only `any` flag for prefix-list entries if destroying
    Destroy `any` flag when creating a prefix-list entry with prefix
    Fix link state memory leak
    Fix vtysh core when handling questionmark
    On bfd peer shutdown actually stop event

ospf6d
    Stop using mtype_tmp in some cases

ospfd, ospf6d
    Add more logging details

ospfd, ospfclient
    Do not just include .c files in another .c

ospfd
    Cleanup some memory leaks on shutdown in ospf_apiserver.c
    Fix for vitual-link crash in signal handler
    Fix interface param type update
    Fix memory leaks w/ `show ip ospf int x json` commands
    Fix ospf_lsa memory leak
    Fix ospf_ti_lfa drop of an entire table
    Fixing summary origination after range configuration
    Free up q_space in early return path
    Log adjacency changes with neighbor ip in addition to neighbor id
    Ospf opaque lsa stale processing fix and topotests.
    Remove mtype_tmp
    Respect loopback's cost that is set and set loopback costs to 0

pbrd
    Fix mismatching in match src-dst

pimd
    Fix use after free issue for ifp's moving vrfs
    Pim not sending register packets after changing from non dr to dr
    Process no-forward bsm packet

ripd
    Fix memory leak for ripd's route-map

tests
    Add test to validate 4-byte ecomm parsing
    Check if prefix-lists with ipv6 any works fine
    Check if route-map works correctly if modifying prefix-lists

tools
    Fix list value remove in frr-reload
    Fix missing remote-as configuration when reload
    Make check flag really work for reload

vtysh
    Give actual pam error messages

zebra
    Cleanup ctx leak on shutdown and turn off event
    Evpn handle del event for dup detected mac
    Fix evpn dup detected local mac del event
    Fix for heap-use-after-free in evpn
    Fix race during shutdown
    Install directly connected route after interface flap
    Reduce creation and fix memory leak of frrscripting pointers
    Unlock the route node when sending route notifications

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
22 months agoMerge pull request #13782 from FRRouting/mergify/bp/stable/8.4/pr-12454
Donald Sharp [Tue, 13 Jun 2023 19:08:00 +0000 (15:08 -0400)]
Merge pull request #13782 from FRRouting/mergify/bp/stable/8.4/pr-12454

bgpd: Ensure stream received has enough data (backport #12454)

22 months agoMerge pull request #13781 from FRRouting/mergify/bp/stable/8.5/pr-12454
Donald Sharp [Tue, 13 Jun 2023 19:07:46 +0000 (15:07 -0400)]
Merge pull request #13781 from FRRouting/mergify/bp/stable/8.5/pr-12454

bgpd: Ensure stream received has enough data (backport #12454)

22 months agoMerge pull request #13784 from FRRouting/mergify/bp/stable/8.5/pr-13612
Donald Sharp [Tue, 13 Jun 2023 19:06:52 +0000 (15:06 -0400)]
Merge pull request #13784 from FRRouting/mergify/bp/stable/8.5/pr-13612

ospfd: fix interface param type update (backport #13612)

22 months agoMerge pull request #13785 from FRRouting/mergify/bp/stable/8.4/pr-13612
Donald Sharp [Tue, 13 Jun 2023 19:06:11 +0000 (15:06 -0400)]
Merge pull request #13785 from FRRouting/mergify/bp/stable/8.4/pr-13612

ospfd: fix interface param type update (backport #13612)

22 months agoospfd: fix interface param type update 13784/head
Chirag Shah [Fri, 26 May 2023 20:43:50 +0000 (13:43 -0700)]
ospfd: fix interface param type update

interface link update event needs
to be handle properly in ospf interface
cache.

Example:
When vrf (interface) is created its default type
would be set to BROADCAST because ifp->status
is not set to VRF.
Subsequent link event sets ifp->status to vrf,
ospf interface update need to compare current type
to new default type which would be VRF (OSPF_IFTYPE_LOOPBACK).
Since ospf type param was created in first add event,
ifp vrf link event didn't update ospf type param which
leads to treat vrf as non loopback interface.

Ticket:#3459451
Testing Done:

Running config suppose to bypass rendering default
network broadcast for loopback/vrf types.

Before fix:

vrf vrf1
 vni 4001
exit-vrf
!
interface vrf1
 ip ospf network broadcast
exit

After fix: (interface vrf1 is not displayed).

vrf vrf1
 vni 4001
exit-vrf

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

22 months agoospfd: fix interface param type update 13785/head
Chirag Shah [Fri, 26 May 2023 20:43:50 +0000 (13:43 -0700)]
ospfd: fix interface param type update

interface link update event needs
to be handle properly in ospf interface
cache.

Example:
When vrf (interface) is created its default type
would be set to BROADCAST because ifp->status
is not set to VRF.
Subsequent link event sets ifp->status to vrf,
ospf interface update need to compare current type
to new default type which would be VRF (OSPF_IFTYPE_LOOPBACK).
Since ospf type param was created in first add event,
ifp vrf link event didn't update ospf type param which
leads to treat vrf as non loopback interface.

Ticket:#3459451
Testing Done:

Running config suppose to bypass rendering default
network broadcast for loopback/vrf types.

Before fix:

vrf vrf1
 vni 4001
exit-vrf
!
interface vrf1
 ip ospf network broadcast
exit

After fix: (interface vrf1 is not displayed).

vrf vrf1
 vni 4001
exit-vrf

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

22 months agobgpd: Ensure stream received has enough data 13782/head
Donald Sharp [Tue, 6 Dec 2022 15:23:11 +0000 (10:23 -0500)]
bgpd: Ensure stream received has enough data

BGP_PREFIX_SID_SRV6_L3_SERVICE attributes must not
fully trust the length value specified in the nlri.
Always ensure that the amount of data we need to read
can be fullfilled.

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

22 months agobgpd: Ensure stream received has enough data 13781/head
Donald Sharp [Tue, 6 Dec 2022 15:23:11 +0000 (10:23 -0500)]
bgpd: Ensure stream received has enough data

BGP_PREFIX_SID_SRV6_L3_SERVICE attributes must not
fully trust the length value specified in the nlri.
Always ensure that the amount of data we need to read
can be fullfilled.

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

22 months agoMerge pull request #13737 from FRRouting/mergify/bp/stable/8.4/pr-13645
Donatas Abraitis [Fri, 9 Jun 2023 06:10:50 +0000 (09:10 +0300)]
Merge pull request #13737 from FRRouting/mergify/bp/stable/8.4/pr-13645

bfdd: remove redundant nb destroy callbacks (backport #13645)

22 months agoMerge pull request #13738 from FRRouting/mergify/bp/stable/8.5/pr-13645
Jafar Al-Gharaibeh [Thu, 8 Jun 2023 21:02:09 +0000 (16:02 -0500)]
Merge pull request #13738 from FRRouting/mergify/bp/stable/8.5/pr-13645

bfdd: remove redundant nb destroy callbacks (backport #13645)

22 months agobfdd: remove redundant nb destroy callbacks 13738/head
Igor Ryzhov [Wed, 31 May 2023 12:28:08 +0000 (15:28 +0300)]
bfdd: remove redundant nb destroy callbacks

Fixes warning logs:
```
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/profile/minimum-ttl'
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/sessions/multi-hop/minimum-ttl'
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit f7884aedf7a1249e3aae71b6a66c9a0f0915c4ef)

22 months agobfdd: remove redundant nb destroy callbacks 13737/head
Igor Ryzhov [Wed, 31 May 2023 12:28:08 +0000 (15:28 +0300)]
bfdd: remove redundant nb destroy callbacks

Fixes warning logs:
```
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/profile/minimum-ttl'
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/sessions/multi-hop/minimum-ttl'
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit f7884aedf7a1249e3aae71b6a66c9a0f0915c4ef)

22 months agoMerge pull request #13713 from FRRouting/mergify/bp/stable/8.4/pr-13693
Donald Sharp [Wed, 7 Jun 2023 12:07:31 +0000 (08:07 -0400)]
Merge pull request #13713 from FRRouting/mergify/bp/stable/8.4/pr-13693

tools: fix list value remove in frr-reload (backport #13693)

22 months agoMerge pull request #13714 from FRRouting/mergify/bp/stable/8.5/pr-13693
Donald Sharp [Wed, 7 Jun 2023 12:07:20 +0000 (08:07 -0400)]
Merge pull request #13714 from FRRouting/mergify/bp/stable/8.5/pr-13693

tools: fix list value remove in frr-reload (backport #13693)

22 months agotools: fix list value remove in frr-reload 13713/head
Chirag Shah [Tue, 6 Jun 2023 04:48:12 +0000 (21:48 -0700)]
tools: fix list value remove in frr-reload

There might be a time element(s) from
temporary list are removed more than once
which leads to valueError in certain python3
version.

commit-id 1543f58b5 did not handle valueError
properly. This caused regression where
prefix-list config leads to delete followed
by add.

The new fix should just pass the exception as
value removal from list_to_add or list_to_del
is best effort.
This allows prefix-list config has no change
then removes the lines from lines_to_del and
lines_to_add properly.

Ticket:#3490252
Testing:

Configure prefix-list in frr.conf and perform
multiple frr-reload. After first reload operatoin
subsequent ones should not result in delete followed
by add of the prefix-list but rather no-op operation.

(Pdb) lines_to_add
[(('ip prefix-list FOO permit 10.2.1.0/24',), None)]
(Pdb) lines_to_del
[(('ip prefix-list FOO seq 5 permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO seq 10 permit 10.2.1.0/24',), None)]
(Pdb) lines_to_del_to_del
[(('ip prefix-list FOO seq 5 permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO seq 10 permit 10.2.1.0/24',), None)]
(Pdb) lines_to_add_to_del
[(('ip prefix-list FOO permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO permit 10.2.1.0/24',), None)]
(Pdb) c
> /usr/lib/frr/frr-reload.py(1562)ignore_delete_re_add_lines()
-> return (lines_to_add, lines_to_del)
(Pdb) lines_to_add
[]
(Pdb) lines_to_del
[]

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

22 months agotools: fix list value remove in frr-reload 13714/head
Chirag Shah [Tue, 6 Jun 2023 04:48:12 +0000 (21:48 -0700)]
tools: fix list value remove in frr-reload

There might be a time element(s) from
temporary list are removed more than once
which leads to valueError in certain python3
version.

commit-id 1543f58b5 did not handle valueError
properly. This caused regression where
prefix-list config leads to delete followed
by add.

The new fix should just pass the exception as
value removal from list_to_add or list_to_del
is best effort.
This allows prefix-list config has no change
then removes the lines from lines_to_del and
lines_to_add properly.

Ticket:#3490252
Testing:

Configure prefix-list in frr.conf and perform
multiple frr-reload. After first reload operatoin
subsequent ones should not result in delete followed
by add of the prefix-list but rather no-op operation.

(Pdb) lines_to_add
[(('ip prefix-list FOO permit 10.2.1.0/24',), None)]
(Pdb) lines_to_del
[(('ip prefix-list FOO seq 5 permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO seq 10 permit 10.2.1.0/24',), None)]
(Pdb) lines_to_del_to_del
[(('ip prefix-list FOO seq 5 permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO seq 10 permit 10.2.1.0/24',), None)]
(Pdb) lines_to_add_to_del
[(('ip prefix-list FOO permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO permit 10.2.1.0/24',), None)]
(Pdb) c
> /usr/lib/frr/frr-reload.py(1562)ignore_delete_re_add_lines()
-> return (lines_to_add, lines_to_del)
(Pdb) lines_to_add
[]
(Pdb) lines_to_del
[]

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

22 months agoMerge pull request #13694 from FRRouting/mergify/bp/stable/8.5/pr-13649
Donatas Abraitis [Tue, 6 Jun 2023 11:12:59 +0000 (14:12 +0300)]
Merge pull request #13694 from FRRouting/mergify/bp/stable/8.5/pr-13649

zebra: Unlock the route node when sending route notifications (backport #13649)

22 months agoMerge pull request #13695 from FRRouting/mergify/bp/stable/8.4/pr-13649
Donatas Abraitis [Tue, 6 Jun 2023 08:08:04 +0000 (11:08 +0300)]
Merge pull request #13695 from FRRouting/mergify/bp/stable/8.4/pr-13649

zebra: Unlock the route node when sending route notifications (backport #13649)

22 months agozebra: Unlock the route node when sending route notifications 13694/head
Donald Sharp [Wed, 31 May 2023 15:40:07 +0000 (11:40 -0400)]
zebra: Unlock the route node when sending route notifications

When using a context to send route notifications to upper
level protocols, the code was using a locking function to
get the route node.  There is no need for this to be locked
as such FRR should free it up.

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

22 months agozebra: Unlock the route node when sending route notifications 13695/head
Donald Sharp [Wed, 31 May 2023 15:40:07 +0000 (11:40 -0400)]
zebra: Unlock the route node when sending route notifications

When using a context to send route notifications to upper
level protocols, the code was using a locking function to
get the route node.  There is no need for this to be locked
as such FRR should free it up.

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

22 months agoMerge pull request #13662 from FRRouting/mergify/bp/stable/8.5/pr-13637
Donald Sharp [Fri, 2 Jun 2023 00:33:02 +0000 (20:33 -0400)]
Merge pull request #13662 from FRRouting/mergify/bp/stable/8.5/pr-13637

lib: fix vtysh core when handling questionmark (backport #13637)

22 months agoMerge pull request #13663 from FRRouting/mergify/bp/stable/8.4/pr-13637
Donald Sharp [Fri, 2 Jun 2023 00:32:52 +0000 (20:32 -0400)]
Merge pull request #13663 from FRRouting/mergify/bp/stable/8.4/pr-13637

lib: fix vtysh core when handling questionmark (backport #13637)

22 months agolib: fix vtysh core when handling questionmark 13662/head
Yuan Yuan [Tue, 30 May 2023 19:20:09 +0000 (19:20 +0000)]
lib: fix vtysh core when handling questionmark

When issue vtysh command with ?, the initial buf size for the
element is 16. Then it would loop through each element in the cmd
output vector. If the required size for printing out the next
element is larger than the current buf size, realloc the buf memory
by doubling the current buf size regardless of the actual size
that's needed. This would cause vtysh core when the doubled size
is not enough for the next element.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
(cherry picked from commit f8aa257997a6a6f69ec5d5715ab04d7cbfae1d1c)

22 months agolib: fix vtysh core when handling questionmark 13663/head
Yuan Yuan [Tue, 30 May 2023 19:20:09 +0000 (19:20 +0000)]
lib: fix vtysh core when handling questionmark

When issue vtysh command with ?, the initial buf size for the
element is 16. Then it would loop through each element in the cmd
output vector. If the required size for printing out the next
element is larger than the current buf size, realloc the buf memory
by doubling the current buf size regardless of the actual size
that's needed. This would cause vtysh core when the doubled size
is not enough for the next element.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
(cherry picked from commit f8aa257997a6a6f69ec5d5715ab04d7cbfae1d1c)

22 months agoMerge pull request #13655 from FRRouting/mergify/bp/stable/8.5/pr-13450
Donatas Abraitis [Thu, 1 Jun 2023 10:26:38 +0000 (13:26 +0300)]
Merge pull request #13655 from FRRouting/mergify/bp/stable/8.5/pr-13450

pim6d: Fix crash in ipv6 pim command (backport #13450)

22 months agopim6d: Fix crash in ipv6 pim command 13655/head
Sarita Patra [Fri, 5 May 2023 17:52:33 +0000 (10:52 -0700)]
pim6d: Fix crash in ipv6 pim command

Problem:
Execute the below commands, pim6d core happens.
interface ens193
 ip address 69.0.0.2/24
 ipv6 address 8000::1/120
 ipv6 mld
 ipv6 pim
We see crash only if the interface is not configured, and
we are executing PIM/MLD commands.

RootCause:
Interface ens193 is not configured. So, it will have
ifindex = 0 and mroute_vif_index = -1.
Currently, we don't enable MLD on an interface if
mroute_vif_index < 0. So, pim_ifp->MLD = NULL.
In the API pim_if_membership_refresh(), we are accessing
pim_ifp->MLD NULL pointer which leads to crash.

Fix:
Added NULL check before accessing pim_ifp->MLD pointer in
the API pim_if_membership_refresh().

Issue: #13385

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

23 months agoMerge pull request #13642 from FRRouting/mergify/bp/stable/8.5/pr-13634
Donatas Abraitis [Wed, 31 May 2023 08:21:05 +0000 (11:21 +0300)]
Merge pull request #13642 from FRRouting/mergify/bp/stable/8.5/pr-13634

bgpd: fix bgpd core when unintern attr (backport #13634)

23 months agoMerge pull request #13643 from FRRouting/mergify/bp/stable/8.4/pr-13634
Donatas Abraitis [Wed, 31 May 2023 08:10:00 +0000 (11:10 +0300)]
Merge pull request #13643 from FRRouting/mergify/bp/stable/8.4/pr-13634

bgpd: fix bgpd core when unintern attr (backport #13634)

23 months agobgpd: fix bgpd core when unintern attr 13642/head
Yuan Yuan [Tue, 30 May 2023 18:53:32 +0000 (18:53 +0000)]
bgpd: fix bgpd core when unintern attr

When the remote peer is neither EBGP nor confed, aspath is the
shadow copy of attr->aspath in bgp_packet_attribute(). Striping
AS4_PATH should not be done on the aspath directly, since
that would lead to bgpd core dump when unintern the attr.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
(cherry picked from commit 32af4995aae647cf9d7c70347ec37b57279ea807)

23 months agobgpd: fix bgpd core when unintern attr 13643/head
Yuan Yuan [Tue, 30 May 2023 18:53:32 +0000 (18:53 +0000)]
bgpd: fix bgpd core when unintern attr

When the remote peer is neither EBGP nor confed, aspath is the
shadow copy of attr->aspath in bgp_packet_attribute(). Striping
AS4_PATH should not be done on the aspath directly, since
that would lead to bgpd core dump when unintern the attr.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
(cherry picked from commit 32af4995aae647cf9d7c70347ec37b57279ea807)

23 months agoMerge pull request #13614 from FRRouting/mergify/bp/stable/8.5/pr-13608
Donatas Abraitis [Sat, 27 May 2023 17:05:27 +0000 (20:05 +0300)]
Merge pull request #13614 from FRRouting/mergify/bp/stable/8.5/pr-13608

vtysh: Give actual pam error messages (backport #13608)

23 months agoMerge pull request #13615 from FRRouting/mergify/bp/stable/8.4/pr-13608
Donatas Abraitis [Sat, 27 May 2023 17:05:17 +0000 (20:05 +0300)]
Merge pull request #13615 from FRRouting/mergify/bp/stable/8.4/pr-13608

vtysh: Give actual pam error messages (backport #13608)

23 months agovtysh: Give actual pam error messages 13614/head
Donald Sharp [Fri, 26 May 2023 11:44:11 +0000 (07:44 -0400)]
vtysh: Give actual pam error messages

Code was was written where the pam error message put out
was the result from a previous call to the pam modules
instead of the current call to the pam module.

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

23 months agovtysh: Give actual pam error messages 13615/head
Donald Sharp [Fri, 26 May 2023 11:44:11 +0000 (07:44 -0400)]
vtysh: Give actual pam error messages

Code was was written where the pam error message put out
was the result from a previous call to the pam modules
instead of the current call to the pam module.

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

23 months agoMerge pull request #13580 from FRRouting/mergify/bp/stable/8.5/pr-13577
Donatas Abraitis [Wed, 24 May 2023 11:14:57 +0000 (14:14 +0300)]
Merge pull request #13580 from FRRouting/mergify/bp/stable/8.5/pr-13577

Fixing show bgp all json format and convert evpn to no pretty output (backport #13577)

23 months agobgpd: Using no pretty json output for l2vpn-Evpn routes 13580/head
Rajasekar Raja [Mon, 22 May 2023 21:14:30 +0000 (14:14 -0700)]
bgpd: Using no pretty json output for l2vpn-Evpn routes

The output of show bgp all json is inconsistent across Address-families
i.e. ipv4/ipv6 is a no pretty format while l2vpn-evpn is in a pretty
format. For huge scale (lots of routes with lots of paths), it is better
to use no_pretty format.

Before fix:
torm-11# sh bgp all json
{
"ipv4Unicast":{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 1,
 "routerId": "27.0.0.15",
 "defaultLocPrf": 100,
 "localAS": 65000,
 "routes": { } }
,
"l2VpnEvpn":{
"routes":{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]":{
      "prefix":"[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]",
      "prefixLen":352,
      "paths":[
<SNIP>.............

After fix:
torm-11# sh bgp all json
{
"ipv4Unicast":{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 1,
 "routerId": "27.0.0.15",
 "defaultLocPrf": 100,
 "localAS": 65000,
 "routes": { } }
,
"l2VpnEvpn":{
"routes":{"27.0.0.15:2":{"rd":"27.0.0.15:2","[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]":{"prefix":"[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]","prefixLen":352,"paths":[[{"valid":true,"bestpath":true,"selectionReason":"First path received","pathFrom":"external","routeType":1,"weight":32768,"peerId":"(unspec)","path":"","origin":"IGP","extendedCommunity"
<SNIP>.............

Issue: 3472865

Ticket:#3472865

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 82465ca7f91c36ea06647f24e218231e6c8854de)

23 months agobgpd: Fix the json output of show bgp all json to be in a valid format
Rajasekar Raja [Mon, 22 May 2023 20:08:34 +0000 (13:08 -0700)]
bgpd: Fix the json output of show bgp all json to be in a valid format

In the json output of show bgp all json, the l2VpnEvpn afi-safi is
missing the 'routes' key making the json output format invalid.

Before Fix:
torm-11# sh bgp all json
{
<SNIP>....................
"l2VpnEvpn":{
{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[4]:[03:44:38:39:ff:ff:01:00:00:01]:[32]:[27.0.0.15]":{
      "prefix":"[4]:[03:44:38:39:ff:ff:01:00:00:01]:[32]:[27.0.0.15]",
      "prefixLen":352,
      "paths":[
<SNIP>....................

After Fix:
torm-11# sh bgp all json
{
<SNIP>....................
"l2VpnEvpn":{
"routes":{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]":{
      "prefix":"[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]",
      "prefixLen":352,
      "paths":[

Issue: 3472865
Ticket:#3472865

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit be66fa05c90bff66b7427e13ccb80bf8ecab2f38)

23 months agoMerge pull request #13572 from FRRouting/mergify/bp/stable/8.4/pr-13506
Donatas Abraitis [Mon, 22 May 2023 19:05:56 +0000 (22:05 +0300)]
Merge pull request #13572 from FRRouting/mergify/bp/stable/8.4/pr-13506

bfdd: Fix malformed session with vrf (backport #13506)

23 months agoMerge pull request #13573 from FRRouting/mergify/bp/stable/8.5/pr-13506
Donatas Abraitis [Mon, 22 May 2023 19:05:40 +0000 (22:05 +0300)]
Merge pull request #13573 from FRRouting/mergify/bp/stable/8.5/pr-13506

bfdd: Fix malformed session with vrf (backport #13506)

23 months agobfdd: Fix malformed session with vrf 13572/head
anlan_cs [Wed, 10 May 2023 14:04:33 +0000 (22:04 +0800)]
bfdd: Fix malformed session with vrf

With this configuration:

```
bfd
 peer 33:33::66 local-address 33:33::88 vrf vrf8 interface enp1s0
 exit
 !
exit
```

The bfd session can't be established with error:

```
bfdd[18663]: [YA0Q5-C0BPV] control-packet: wrong vrfid. [mhop:no peer:33:33::66 local:33:33::88 port:2 vrf:61]
```

The vrf check should use the carefully adjusted `vrfid`, which is
based on globally/reliable interface.  We can't believe the
`bvrf->vrf->vrf_id` because the `/proc/sys/net/ipv4/udp_l3mdev_accept`
maybe is set "1" in VRF-lite backend even with security drawback.

Just correct the vrf check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit b17c179664da7331a4669a1cf548e4e9c48a5477)

23 months agobfdd: Fix malformed session with vrf 13573/head
anlan_cs [Wed, 10 May 2023 14:04:33 +0000 (22:04 +0800)]
bfdd: Fix malformed session with vrf

With this configuration:

```
bfd
 peer 33:33::66 local-address 33:33::88 vrf vrf8 interface enp1s0
 exit
 !
exit
```

The bfd session can't be established with error:

```
bfdd[18663]: [YA0Q5-C0BPV] control-packet: wrong vrfid. [mhop:no peer:33:33::66 local:33:33::88 port:2 vrf:61]
```

The vrf check should use the carefully adjusted `vrfid`, which is
based on globally/reliable interface.  We can't believe the
`bvrf->vrf->vrf_id` because the `/proc/sys/net/ipv4/udp_l3mdev_accept`
maybe is set "1" in VRF-lite backend even with security drawback.

Just correct the vrf check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit b17c179664da7331a4669a1cf548e4e9c48a5477)

23 months agoMerge pull request #13520 from FRRouting/mergify/bp/stable/8.5/pr-13444
Mark Stapp [Fri, 12 May 2023 21:08:26 +0000 (17:08 -0400)]
Merge pull request #13520 from FRRouting/mergify/bp/stable/8.5/pr-13444

zebra: Fix dp_out_queued counter to actually reflect real life (backport #13444)

23 months agozebra: Fix dp_out_queued counter to actually reflect real life 13520/head
Donald Sharp [Fri, 5 May 2023 14:37:11 +0000 (10:37 -0400)]
zebra: Fix dp_out_queued counter to actually reflect real life

The prov->dp_out_queued counter was never being decremented
when a ctx was pulled off of the list.  Let's change it to
accurately reflect real life.

Broken:
janelle.pinkbelly.org# show zebra dplane providers detailed
Zebra dataplane providers:
Kernel (1): in: 330872, q: 0, q_max: 100, out: 330872, q: 330872, q_max: 330872
janelle.pinkbelly.org#

Fixed:
sharpd@janelle:/tmp/topotests$ vtysh -c "show zebra dplane providers detailed"
Zebra dataplane providers:
Kernel (1): in: 221495, q: 0, q_max: 100, out: 221495, q: 0, q_max: 100
sharpd@janelle:/tmp/topotests$

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

23 months agoMerge pull request #13504 from FRRouting/mergify/bp/stable/8.5/pr-13489
Jafar Al-Gharaibeh [Thu, 11 May 2023 04:00:36 +0000 (23:00 -0500)]
Merge pull request #13504 from FRRouting/mergify/bp/stable/8.5/pr-13489

ospfd: OSPF opaque LSA stale processing fix and topotests. (backport #13489)

23 months agoMerge pull request #13503 from FRRouting/mergify/bp/stable/8.4/pr-13489
Jafar Al-Gharaibeh [Thu, 11 May 2023 04:00:27 +0000 (23:00 -0500)]
Merge pull request #13503 from FRRouting/mergify/bp/stable/8.4/pr-13489

ospfd: OSPF opaque LSA stale processing fix and topotests. (backport #13489)

23 months ago ospfd: OSPF opaque LSA stale processing fix and topotests. 13504/head
Acee [Tue, 9 May 2023 20:51:03 +0000 (16:51 -0400)]
    ospfd: OSPF opaque LSA stale processing fix and topotests.

        1. Fix OSPF opaque LSA processing to preserve the stale opaque
            LSAs in the Link State Database for 60 seconds consistent with
            what is done for other LSA types.
         2. Add a topotest that tests for cases where ospfd is restarted
            and a stale OSPF opaque LSA exists in the OSPF routing domain
            both when the LSA is purged and when the LSA is reoriginagted
            with a more recent instance.

Signed-off-by: Acee <aceelindem@gmail.com>
(cherry picked from commit 4e7eb1e62ce54ebcf78622682de962fdeff20b80)

23 months ago ospfd: OSPF opaque LSA stale processing fix and topotests. 13503/head
Acee [Tue, 9 May 2023 20:51:03 +0000 (16:51 -0400)]
    ospfd: OSPF opaque LSA stale processing fix and topotests.

        1. Fix OSPF opaque LSA processing to preserve the stale opaque
            LSAs in the Link State Database for 60 seconds consistent with
            what is done for other LSA types.
         2. Add a topotest that tests for cases where ospfd is restarted
            and a stale OSPF opaque LSA exists in the OSPF routing domain
            both when the LSA is purged and when the LSA is reoriginagted
            with a more recent instance.

Signed-off-by: Acee <aceelindem@gmail.com>
(cherry picked from commit 4e7eb1e62ce54ebcf78622682de962fdeff20b80)

23 months agoMerge pull request #13501 from FRRouting/mergify/bp/stable/8.4/pr-13485
Donald Sharp [Wed, 10 May 2023 18:23:47 +0000 (14:23 -0400)]
Merge pull request #13501 from FRRouting/mergify/bp/stable/8.4/pr-13485

ospfd: Respect loopback's cost that is set and set loopback costs to 0 (backport #13485)

23 months agoMerge pull request #13502 from FRRouting/mergify/bp/stable/8.5/pr-13485
Donald Sharp [Wed, 10 May 2023 18:21:35 +0000 (14:21 -0400)]
Merge pull request #13502 from FRRouting/mergify/bp/stable/8.5/pr-13485

ospfd: Respect loopback's cost that is set and set loopback costs to 0 (backport #13485)

23 months agoospfd: Respect loopback's cost that is set and set loopback costs to 0 13501/head
Donald Sharp [Tue, 9 May 2023 17:10:35 +0000 (13:10 -0400)]
ospfd: Respect loopback's cost that is set and set loopback costs to 0

When setting an loopback's cost, set the value to 0, unless the operator
has assigned a value for the loopback's cost.

RFC states:

If the state of the interface is Loopback, add a Type 3
link (stub network) as long as this is not an interface
to an unnumbered point-to-point network. The Link ID
should be set to the IP interface address, the Link Data
set to the mask 0xffffffff (indicating a host route),
and the cost set to 0.

FRR is going to allow this to be overridden if the operator specifically
sets a value too.

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

23 months agoospfd: Respect loopback's cost that is set and set loopback costs to 0 13502/head
Donald Sharp [Tue, 9 May 2023 17:10:35 +0000 (13:10 -0400)]
ospfd: Respect loopback's cost that is set and set loopback costs to 0

When setting an loopback's cost, set the value to 0, unless the operator
has assigned a value for the loopback's cost.

RFC states:

If the state of the interface is Loopback, add a Type 3
link (stub network) as long as this is not an interface
to an unnumbered point-to-point network. The Link ID
should be set to the IP interface address, the Link Data
set to the mask 0xffffffff (indicating a host route),
and the cost set to 0.

FRR is going to allow this to be overridden if the operator specifically
sets a value too.

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

23 months agoMerge pull request #13497 from opensourcerouting/fix/backport_05dbe64457e4a7b2ccae03c...
Donald Sharp [Wed, 10 May 2023 16:07:13 +0000 (12:07 -0400)]
Merge pull request #13497 from opensourcerouting/fix/backport_05dbe64457e4a7b2ccae03cce3c955364641f789

doc: Add `neighbor aigp` command for BGP

23 months agodoc: Add `neighbor aigp` command for BGP 13497/head
Donatas Abraitis [Tue, 9 May 2023 18:21:34 +0000 (21:21 +0300)]
doc: Add `neighbor aigp` command for BGP

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agoMerge pull request #13474 from opensourcerouting/fix/backport_53afb27eb892a107c9426a0...
Donald Sharp [Tue, 9 May 2023 17:35:56 +0000 (13:35 -0400)]
Merge pull request #13474 from opensourcerouting/fix/backport_53afb27eb892a107c9426a01dbba82bee6fa86a7

bgpd: AIGP should be non-transitive (backport)

23 months agoMerge pull request #13475 from opensourcerouting/fix/backport_871b46e7eb86009f1bea3cf...
Donald Sharp [Tue, 9 May 2023 17:35:33 +0000 (13:35 -0400)]
Merge pull request #13475 from opensourcerouting/fix/backport_871b46e7eb86009f1bea3cf397a8d2c38ceacd40

lib: Fix memory leaks in Link State library (backport)

23 months agoMerge pull request #13482 from FRRouting/mergify/bp/stable/8.4/pr-13445
Donald Sharp [Tue, 9 May 2023 17:31:10 +0000 (13:31 -0400)]
Merge pull request #13482 from FRRouting/mergify/bp/stable/8.4/pr-13445

zebra: Reduce creation and fix memory leak of frrscripting pointers (backport #13445)

23 months agoMerge pull request #13483 from opensourcerouting/fix/backport_d8be1399720ca36485b6a22...
Donald Sharp [Tue, 9 May 2023 17:30:51 +0000 (13:30 -0400)]
Merge pull request #13483 from opensourcerouting/fix/backport_d8be1399720ca36485b6a2209b143679b01b83cb

zebra: Reduce creation and fix memory leak of frrscripting pointers

23 months agozebra: Reduce creation and fix memory leak of frrscripting pointers 13483/head
Donald Sharp [Fri, 5 May 2023 15:05:12 +0000 (11:05 -0400)]
zebra: Reduce creation and fix memory leak of frrscripting pointers

There are two issues being addressed:

a) The ZEBRA_ON_RIB_PROCESS_HOOK_CALL script point
was creating a fs pointer per dplane ctx in
rib_process_dplane_results().

b) The fs pointer was not being deleted and directly
leaked.

For (a) Move the creation of the fs to outside
the do while loop.

For (b) At function end ensure that the pointer
is actually deleted.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agozebra: Reduce creation and fix memory leak of frrscripting pointers 13482/head
Donald Sharp [Fri, 5 May 2023 15:05:12 +0000 (11:05 -0400)]
zebra: Reduce creation and fix memory leak of frrscripting pointers

There are two issues being addressed:

a) The ZEBRA_ON_RIB_PROCESS_HOOK_CALL script point
was creating a fs pointer per dplane ctx in
rib_process_dplane_results().

b) The fs pointer was not being deleted and directly
leaked.

For (a) Move the creation of the fs to outside
the do while loop.

For (b) At function end ensure that the pointer
is actually deleted.

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

23 months agotests: Adjust AIGP metric numbers for iBGP setup 13474/head
Donatas Abraitis [Mon, 8 May 2023 20:22:26 +0000 (23:22 +0300)]
tests: Adjust AIGP metric numbers for iBGP setup

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agolib: Link State memory corruption 13475/head
Olivier Dugeon [Fri, 21 Apr 2023 16:09:28 +0000 (18:09 +0200)]
lib: Link State memory corruption

In function ls_find_subnet(), prefix argument is directly copied into
subnet.key structure to find corresponding subnet in RB Tree. This could leadr
to a memory corruption. Function prefix_copy() must be used instead.

This patch replaces the direct prefix copy by a call to prefix_copy() function
to avoid this memory issue.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agolib: Fix memory leak in in Link State
Olivier Dugeon [Fri, 21 Apr 2023 16:16:34 +0000 (18:16 +0200)]
lib: Fix memory leak in in Link State

When using ls_stream2ted() function to parse Opaque Link State message to local
TED, in case of vertex or subnet deletion, the function return a pointer to the
deleted ls_element instead of NULL. This could lead into a potential pointer
corruption when caller try to access to the deleted ls_element.

This patch ensure that the ls_element pointer return by ls_stream2ted()
function is NULL when the message event is a delete operation for vertex and
subnet. Note that edge deletion was correctly handled.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
23 months agobgpd: Make sure AIGP attribute is non-transitive
Donatas Abraitis [Mon, 8 May 2023 19:49:10 +0000 (22:49 +0300)]
bgpd: Make sure AIGP attribute is non-transitive

The AIGP attribute is an optional, non-transitive BGP path attribute.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agoMerge pull request #13442 from FRRouting/mergify/bp/stable/8.5/pr-13436
Donatas Abraitis [Fri, 5 May 2023 16:49:41 +0000 (19:49 +0300)]
Merge pull request #13442 from FRRouting/mergify/bp/stable/8.5/pr-13436

ospfd: Fix memory leaks w/ `show ip ospf int X json` commands (backport #13436)

23 months agoMerge pull request #13443 from FRRouting/mergify/bp/stable/8.4/pr-13436
Donatas Abraitis [Fri, 5 May 2023 16:49:22 +0000 (19:49 +0300)]
Merge pull request #13443 from FRRouting/mergify/bp/stable/8.4/pr-13436

ospfd: Fix memory leaks w/ `show ip ospf int X json` commands (backport #13436)

23 months agoospfd: Fix memory leaks w/ `show ip ospf int X json` commands 13442/head
Donald Sharp [Thu, 4 May 2023 16:53:42 +0000 (12:53 -0400)]
ospfd: Fix memory leaks w/ `show ip ospf int X json` commands

FRR has a memory leak in the case when int X does not
exist and a memory leak when int X does exist.  Fix
these

Fixes: #13434
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 74e21732db129f7287d5ab227e45f305c5dbf34e)

23 months agoospfd: Fix memory leaks w/ `show ip ospf int X json` commands 13443/head
Donald Sharp [Thu, 4 May 2023 16:53:42 +0000 (12:53 -0400)]
ospfd: Fix memory leaks w/ `show ip ospf int X json` commands

FRR has a memory leak in the case when int X does not
exist and a memory leak when int X does exist.  Fix
these

Fixes: #13434
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 74e21732db129f7287d5ab227e45f305c5dbf34e)

23 months agoMerge pull request #13420 from FRRouting/mergify/bp/stable/8.5/pr-13020
Jafar Al-Gharaibeh [Thu, 4 May 2023 14:01:03 +0000 (09:01 -0500)]
Merge pull request #13420 from FRRouting/mergify/bp/stable/8.5/pr-13020

pimd: PIM not sending register packets after changing from non DR to DR (backport #13020)

23 months agoMerge pull request #13419 from FRRouting/mergify/bp/stable/8.4/pr-13020
Jafar Al-Gharaibeh [Thu, 4 May 2023 14:00:46 +0000 (09:00 -0500)]
Merge pull request #13419 from FRRouting/mergify/bp/stable/8.4/pr-13020

pimd: PIM not sending register packets after changing from non DR to DR (backport #13020)

23 months agopimd: PIM not sending register packets after changing from non DR to DR 13419/head
Sai Gomathi N [Fri, 17 Mar 2023 10:51:16 +0000 (03:51 -0700)]
pimd: PIM not sending register packets after changing from non DR to DR

When the router is non dr for an interface, it installs mroute to drop
the packets from directly connected source. This was done to avoid packets
coming to cpu as nocache hit. Later when it gets change from non-DR to DR,
these entries are not cleared. So the packets are still dropped.
This causes register packets not getting generated.
So cleaning up the mroute entries and channel oil without
upstream reference which was created to drop.

Co-authored-by: Saravanan K <saravanank@vmware.com>
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
(cherry picked from commit 1c883aef96013753f5467ba5e5028dee0f0a82c5)

23 months agopimd: PIM not sending register packets after changing from non DR to DR 13420/head
Sai Gomathi N [Fri, 17 Mar 2023 10:51:16 +0000 (03:51 -0700)]
pimd: PIM not sending register packets after changing from non DR to DR

When the router is non dr for an interface, it installs mroute to drop
the packets from directly connected source. This was done to avoid packets
coming to cpu as nocache hit. Later when it gets change from non-DR to DR,
these entries are not cleared. So the packets are still dropped.
This causes register packets not getting generated.
So cleaning up the mroute entries and channel oil without
upstream reference which was created to drop.

Co-authored-by: Saravanan K <saravanank@vmware.com>
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
(cherry picked from commit 1c883aef96013753f5467ba5e5028dee0f0a82c5)

2 years agoMerge pull request #13371 from FRRouting/mergify/bp/stable/8.5/pr-13330
Donatas Abraitis [Mon, 24 Apr 2023 19:07:10 +0000 (22:07 +0300)]
Merge pull request #13371 from FRRouting/mergify/bp/stable/8.5/pr-13330

zebra: EVPN handle duplicate detected local mac delete event (backport #13330)

2 years agoMerge pull request #13372 from FRRouting/mergify/bp/stable/8.4/pr-13330
Donatas Abraitis [Mon, 24 Apr 2023 18:28:33 +0000 (21:28 +0300)]
Merge pull request #13372 from FRRouting/mergify/bp/stable/8.4/pr-13330

zebra: EVPN handle duplicate detected local mac delete event (backport #13330)

2 years agozebra:fix evpn dup detected local mac del event 13372/head
Chirag Shah [Sat, 22 Oct 2022 23:00:14 +0000 (16:00 -0700)]
zebra:fix evpn dup detected local mac del event

The current local mac delete event send to flag with force
always which breaks the duplicate detected MACs where
it requires to be resynced from bgpd to earlier state.

Ticket:#3233019
Issue:3233019

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

2 years agozebra: evpn handle del event for dup detected mac
Chirag Shah [Wed, 1 Dec 2021 04:42:01 +0000 (20:42 -0800)]
zebra: evpn handle del event for dup detected mac

Upon receiving local mobility event for MAC + NEIGH,
both are detected as duplicate upon hitting DAD threshold.

Duplicated detected ( freezed) MAC + NEIGH are not known
to bgpd.

If locally learnt MAC + NEIGH are deleted in kernel,
the MAC is marked as AUTO after sending delete event
to bgpd.

Bgpd only reinstalls best route for MAC_IP route (NEIGH)
but not for MAC event.
This puts a situation where MAC is AUTO state and
associated neigh as remote.

Fix:
DUPLICATE + LOCAL MAC deletion, set MAC delete request
as reinstall from bgpd.

Ticket:#2873307
Reviewed By:
Testing Done:

Freeze MAC + two NEIGHs in local mobility event.
Delete MAC and NEIGH from kerenl.
bgp rsync remote mac route which puts MAC to remote state.

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

2 years agozebra:fix evpn dup detected local mac del event 13371/head
Chirag Shah [Sat, 22 Oct 2022 23:00:14 +0000 (16:00 -0700)]
zebra:fix evpn dup detected local mac del event

The current local mac delete event send to flag with force
always which breaks the duplicate detected MACs where
it requires to be resynced from bgpd to earlier state.

Ticket:#3233019
Issue:3233019

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

2 years agozebra: evpn handle del event for dup detected mac
Chirag Shah [Wed, 1 Dec 2021 04:42:01 +0000 (20:42 -0800)]
zebra: evpn handle del event for dup detected mac

Upon receiving local mobility event for MAC + NEIGH,
both are detected as duplicate upon hitting DAD threshold.

Duplicated detected ( freezed) MAC + NEIGH are not known
to bgpd.

If locally learnt MAC + NEIGH are deleted in kernel,
the MAC is marked as AUTO after sending delete event
to bgpd.

Bgpd only reinstalls best route for MAC_IP route (NEIGH)
but not for MAC event.
This puts a situation where MAC is AUTO state and
associated neigh as remote.

Fix:
DUPLICATE + LOCAL MAC deletion, set MAC delete request
as reinstall from bgpd.

Ticket:#2873307
Reviewed By:
Testing Done:

Freeze MAC + two NEIGHs in local mobility event.
Delete MAC and NEIGH from kerenl.
bgp rsync remote mac route which puts MAC to remote state.

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

2 years agoFRR Release 8.5.1 docker/8.5.1 frr-8.5.1
Jafar Al-Gharaibeh [Sat, 22 Apr 2023 18:03:13 +0000 (13:03 -0500)]
FRR Release 8.5.1

* Bug Fixes

bgpd
  - Fix crash due to community aliases size
  - Aggregate-address memory leak fix
  - Bmp fix peer-up ports byte order
  - Check 7 bytes for long-lived graceful-restart capability
  - Copy the password from the previous peer on peer_xfer_config()
  - Do not allow a `no router bgp xxx` when autoimport is happening
  - Do not allow l3vni changes when shutting down
  - Do not announce routes immediatelly on filter updates
  - Do not call bgp_soft_reconfig_in() twice in a row on policy change
  - Evpn-mh esi not active suppress ead-es route
  - Fix crash for `show bgp ... neighbor received-routes detail|prefix`
  - Fix debug output for route-map names when using a unsuppress-map
  - Fix ecommunity parsing for as4
  - Fix for ain->attr corruption during path update
  - Increase buffer size used for dumping bgp to mrt files
  - Limit flowspec to no attribute means a implicit withdrawal
  - Prevent null pointer deref when outputting data

lib
   - Adjust only `any` flag for prefix-list entries if destroying
   - Destroy `any` flag when creating a prefix-list entry with prefix
   - Fix clear route-map cmd using defpy
   - Fix link state memory leak
   - Include clippy generated commands for routemap.c
   - On bfd peer shutdown actually stop event

ospfd
   - Cleanup some memory leaks on shutdown in ospf_apiserver.c
   - Fix for vitual-link crash in signal handler
   - Fix ospf_lsa memory leak
   - Fix ospf_ti_lfa drop of an entire table
   - Fixing summary origination after range configuration
   - Free up q_space in early return path
   - Log adjacency changes with neighbor ip in addition to neighbor id

pbrd
   - Fix mismatching in match src-dst

pim6d
   - Fixing mroutes not created after disabling and enabling pimv6.

pimd
   - Fix use after free issue for ifp's moving vrfs
   - In_multicast needs host order
   - Process no-forward bsm packet

ripd
   - Fix malformed route-map
   - Fix memory leak for ripd's route-map

staticd
   - Tell bfd that we are shutting down

tools
   - Fix missing remote-as configuration when reload
   - Frr-reload fix list value not present
   - Make check flag really work for reload
   - Set correct directory of vtysh for frr-reload.py

zebrad
   - Add link_nsid to zebra interface
   - Cleanup ctx leak on shutdown and turn off event
   - Evpn mh sync mac install as inactive
   - Fix for heap-use-after-free in evpn
   - Fix race during shutdown
   - Install directly connected route after interface flap

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #13344 from opensourcerouting/fix/backport_8cb4892c0669d916557d693...
Donald Sharp [Fri, 21 Apr 2023 11:10:36 +0000 (07:10 -0400)]
Merge pull request #13344 from opensourcerouting/fix/backport_8cb4892c0669d916557d693b878420faec8e6e2a

bgpd: [8.5] Fix lcom->str string length to correctly cover aliases

2 years agoMerge pull request #13343 from FRRouting/mergify/bp/stable/8.4/pr-13341
Donald Sharp [Fri, 21 Apr 2023 11:10:23 +0000 (07:10 -0400)]
Merge pull request #13343 from FRRouting/mergify/bp/stable/8.4/pr-13341

bgpd: Fix lcom->str string length to correctly cover aliases (backport #13341)

2 years agobgpd: Fix lcom->str string length to correctly cover aliases 13344/head
Donald Sharp [Thu, 20 Apr 2023 20:27:20 +0000 (16:27 -0400)]
bgpd: Fix lcom->str string length to correctly cover aliases

If you have a very large number of large communities whose
string length happened to be greater than BUFSIZ FRR's bgpd
would crash.  This is because bgpd would write beyond
the end of the string.

Originally the code auto-calculated the string size appropriately
but commit ed0e57e3f079352714c3a3a8a5b0dddf4aadfe1d modified
the string length to be a hard coded BUFSIZ.  When a route-map
like this is added:

route-map LARGE-OUT permit 10
 set large-community 4635:0:0 4635:1:906 4635:1:2906 4635:1:4515 4635:1:4594 4635:1:4641 4635:1:4760 4635:1:7979 4635:1:9253 4635:1:9293 4635:1:9304 4635:1:9908 4635:1:13335 4635:1:16265 4635:1:17924 4635:1:18013 4635:1:20940 4635:1:22822 4635:1:24429 4635:1:24482 4635:1:32590 4635:1:32934 4635:1:36692 4635:1:38008 4635:1:38819 4635:1:41378 4635:1:45753 4635:1:46489 4635:1:49544 4635:1:51847 4635:1:54574 4635:1:54994 4635:1:55720 4635:1:56059 4635:1:57724 4635:1:65021 4635:1:134823 4635:1:136907 4635:1:146961 24115:0:24115 24115:1:906 24115:1:2906 24115:1:4515 24115:1:4594 24115:1:4641 24115:1:4760 24115:1:7979 24115:1:9253 24115:1:9293 24115:1:9304 24115:1:9908 24115:1:13335 24115:1:16265 24115:1:17924 24115:1:18013 24115:1:20940 24115:1:22822 24115:1:24429 24115:1:24482 24115:1:32590 24115:1:32934 24115:1:36692 24115:1:38008 24115:1:38819 24115:1:41378 24115:1:45753 24115:1:46489 24115:1:49544 24115:1:51847 24115:1:54574 24115:1:54994 24115:1:55720 24115:1:56059 24115:1:57724 24115:1:65021 24115:1:134823 24115:1:136907 24115:1:100000 24115:1:100001 24115:1:100002
exit

BGP would have issues and crash.

Modify the code to correctly determine the string length of the communities
and to also double check if the string has an alias and ensure that the
string is still sufficiently large enough.  If not auto size it again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Fix lcom->str string length to correctly cover aliases 13343/head
Donald Sharp [Thu, 20 Apr 2023 20:27:20 +0000 (16:27 -0400)]
bgpd: Fix lcom->str string length to correctly cover aliases

If you have a very large number of large communities whose
string length happened to be greater than BUFSIZ FRR's bgpd
would crash.  This is because bgpd would write beyond
the end of the string.

Originally the code auto-calculated the string size appropriately
but commit ed0e57e3f079352714c3a3a8a5b0dddf4aadfe1d modified
the string length to be a hard coded BUFSIZ.  When a route-map
like this is added:

route-map LARGE-OUT permit 10
 set large-community 4635:0:0 4635:1:906 4635:1:2906 4635:1:4515 4635:1:4594 4635:1:4641 4635:1:4760 4635:1:7979 4635:1:9253 4635:1:9293 4635:1:9304 4635:1:9908 4635:1:13335 4635:1:16265 4635:1:17924 4635:1:18013 4635:1:20940 4635:1:22822 4635:1:24429 4635:1:24482 4635:1:32590 4635:1:32934 4635:1:36692 4635:1:38008 4635:1:38819 4635:1:41378 4635:1:45753 4635:1:46489 4635:1:49544 4635:1:51847 4635:1:54574 4635:1:54994 4635:1:55720 4635:1:56059 4635:1:57724 4635:1:65021 4635:1:134823 4635:1:136907 4635:1:146961 24115:0:24115 24115:1:906 24115:1:2906 24115:1:4515 24115:1:4594 24115:1:4641 24115:1:4760 24115:1:7979 24115:1:9253 24115:1:9293 24115:1:9304 24115:1:9908 24115:1:13335 24115:1:16265 24115:1:17924 24115:1:18013 24115:1:20940 24115:1:22822 24115:1:24429 24115:1:24482 24115:1:32590 24115:1:32934 24115:1:36692 24115:1:38008 24115:1:38819 24115:1:41378 24115:1:45753 24115:1:46489 24115:1:49544 24115:1:51847 24115:1:54574 24115:1:54994 24115:1:55720 24115:1:56059 24115:1:57724 24115:1:65021 24115:1:134823 24115:1:136907 24115:1:100000 24115:1:100001 24115:1:100002
exit

BGP would have issues and crash.

Modify the code to correctly determine the string length of the communities
and to also double check if the string has an alias and ensure that the
string is still sufficiently large enough.  If not auto size it again.

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

2 years agoMerge pull request #13339 from FRRouting/mergify/bp/stable/8.4/pr-13329
Jafar Al-Gharaibeh [Thu, 20 Apr 2023 04:06:34 +0000 (23:06 -0500)]
Merge pull request #13339 from FRRouting/mergify/bp/stable/8.4/pr-13329

bgpd: Fix for ain->attr corruption during path update (backport #13329)

2 years agoMerge pull request #13338 from FRRouting/mergify/bp/stable/8.5/pr-13329
Jafar Al-Gharaibeh [Thu, 20 Apr 2023 04:06:24 +0000 (23:06 -0500)]
Merge pull request #13338 from FRRouting/mergify/bp/stable/8.5/pr-13329

bgpd: Fix for ain->attr corruption during path update (backport #13329)

2 years agobgpd: Fix for ain->attr corruption during path update 13339/head
Pooja Jagadeesh Doijode [Wed, 19 Apr 2023 01:40:06 +0000 (18:40 -0700)]
bgpd: Fix for ain->attr corruption during path update

1. Consider a established L2VPN EVPN BGP peer with soft-reconfiguartion
   inbound configured

2. When the interface of this directly connected BGP peer is shutdown,
   bgp_soft_reconfig_table_update() is called, which memsets the evpn buffer
   and calls bgp_update() with received attributes stored in ain table(ain->attr).
   In bgp_update(), evpn_overlay attribute in ain->attr (which is an interned
   attr) was modified by doing a memcpy

3. Above action causes 2 attributes in the attrhash (which were previously different)
   to match!

4. Later during fsm change event of the peer, bgp_adj_in_remove() is called
   to clean up the ain->attr. But, because 2 attrs in attrhash match, it causes
   BGP to assert in bgp_attr_unintern()

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
(cherry picked from commit 6e076ba5231cba2e22dcbdc48a9c13df046a2e47)

2 years agobgpd: Fix for ain->attr corruption during path update 13338/head
Pooja Jagadeesh Doijode [Wed, 19 Apr 2023 01:40:06 +0000 (18:40 -0700)]
bgpd: Fix for ain->attr corruption during path update

1. Consider a established L2VPN EVPN BGP peer with soft-reconfiguartion
   inbound configured

2. When the interface of this directly connected BGP peer is shutdown,
   bgp_soft_reconfig_table_update() is called, which memsets the evpn buffer
   and calls bgp_update() with received attributes stored in ain table(ain->attr).
   In bgp_update(), evpn_overlay attribute in ain->attr (which is an interned
   attr) was modified by doing a memcpy

3. Above action causes 2 attributes in the attrhash (which were previously different)
   to match!

4. Later during fsm change event of the peer, bgp_adj_in_remove() is called
   to clean up the ain->attr. But, because 2 attrs in attrhash match, it causes
   BGP to assert in bgp_attr_unintern()

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
(cherry picked from commit 6e076ba5231cba2e22dcbdc48a9c13df046a2e47)

2 years agoMerge pull request #13317 from FRRouting/mergify/bp/stable/8.5/pr-13312
Donatas Abraitis [Sun, 16 Apr 2023 15:58:32 +0000 (18:58 +0300)]
Merge pull request #13317 from FRRouting/mergify/bp/stable/8.5/pr-13312

zebra: EVPN MH ES-peer Sync MAC installed as inactive (backport #13312)

2 years agoMerge pull request #13315 from FRRouting/mergify/bp/stable/8.5/pr-13302
Donatas Abraitis [Sun, 16 Apr 2023 15:58:22 +0000 (18:58 +0300)]
Merge pull request #13315 from FRRouting/mergify/bp/stable/8.5/pr-13302

tools: fix missing remote-as configuration when reload (backport #13302)

2 years agoMerge pull request #13316 from FRRouting/mergify/bp/stable/8.4/pr-13302
Donatas Abraitis [Sun, 16 Apr 2023 15:58:15 +0000 (18:58 +0300)]
Merge pull request #13316 from FRRouting/mergify/bp/stable/8.4/pr-13302

tools: fix missing remote-as configuration when reload (backport #13302)

2 years agozebra: evpn mh sync mac install as inactive 13317/head
Chirag Shah [Fri, 14 Apr 2023 19:57:23 +0000 (12:57 -0700)]
zebra: evpn mh sync mac install as inactive

EVPN MH ES reduendant VTEPs need to install
sync MAC as notify inactive and generate
ND:Proxy stamped extended community on Type-2
route.

Ticket:#3436621
Issue:3436621

Testing Done:

tor-11 originates type-2 MAC route:

tor-11# bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify master bridge static

tor-12 receives sync MAC route:

Before fix:
----------
tor-12:/# bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify master bridge static

After fix: inactive is set to MAC entry
----------
tor-12:/#bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify inactive master bridge
static

Notice the difference in `inactive` post notify on tor-12
with the fix.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 4a1f91a366bacc8178afcc3d2712e08a3ba3e1ba)