]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agozebra: Cleanup the memory from the hash for MPLS stuff
Donatas Abraitis [Mon, 18 Jul 2022 11:26:29 +0000 (14:26 +0300)]
zebra: Cleanup the memory from the hash for MPLS stuff

==1595641== 280 (80 direct, 200 indirect) bytes in 1 blocks are definitely lost in loss record 30 of 38
==1595641== at 0x483AB65: calloc (vg_replace_malloc.c:760)
==1595641== by 0x493C89C: qcalloc (memory.c:116)
==1595641== by 0x1E8426: lsp_alloc (zebra_mpls.c:1116)
==1595641== by 0x49147F1: hash_get (hash.c:162)
==1595641== by 0x1EC880: mpls_lsp_install (zebra_mpls.c:3192)
==1595641== by 0x1C51BB: zread_vrf_label (zapi_msg.c:3197)
==1595641== by 0x1C6F11: zserv_handle_commands (zapi_msg.c:3863)
==1595641== by 0x24D0F4: zserv_process_messages (zserv.c:523)
==1595641== by 0x498F4CC: thread_call (thread.c:2002)
==1595641== by 0x49253A2: frr_run (libfrr.c:1198)
==1595641== by 0x1A28BA: main (main.c:475)
==1595641==
==1595641== 1,400 (400 direct, 1,000 indirect) bytes in 5 blocks are definitely lost in loss record 35 of 38
==1595641== at 0x483AB65: calloc (vg_replace_malloc.c:760)
==1595641== by 0x493C89C: qcalloc (memory.c:116)
==1595641== by 0x1E8426: lsp_alloc (zebra_mpls.c:1116)
==1595641== by 0x49147F1: hash_get (hash.c:162)
==1595641== by 0x1EBD7C: mpls_zapi_labels_process (zebra_mpls.c:2915)
==1595641== by 0x1C35D9: zread_mpls_labels_add (zapi_msg.c:2513)
==1595641== by 0x1C6F11: zserv_handle_commands (zapi_msg.c:3863)
==1595641== by 0x24D0F4: zserv_process_messages (zserv.c:523)
==1595641== by 0x498F4CC: thread_call (thread.c:2002)
==1595641== by 0x49253A2: frr_run (libfrr.c:1198)
==1595641== by 0x1A28BA: main (main.c:475)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11627 from qlyoung/update-alpine-build
Donatas Abraitis [Mon, 18 Jul 2022 08:50:35 +0000 (11:50 +0300)]
Merge pull request #11627 from qlyoung/update-alpine-build

Update Alpine packaging foo + change docker images back over to Alpine-provided libyang

2 years agoMerge pull request #11629 from mobash-rasool/fixes2
Donatas Abraitis [Mon, 18 Jul 2022 08:43:49 +0000 (11:43 +0300)]
Merge pull request #11629 from mobash-rasool/fixes2

pimd: Remove the api from .h file since there is no definition of it

2 years agoMerge pull request #11601 from fdumontet6WIND/FMJA/L3VPN
Donatas Abraitis [Mon, 18 Jul 2022 06:14:56 +0000 (09:14 +0300)]
Merge pull request #11601 from fdumontet6WIND/FMJA/L3VPN

bmp add L3VPN support

2 years agopimd: Remove the api from .h file since there is no definition of it
Mobashshera Rasool [Mon, 18 Jul 2022 06:01:52 +0000 (23:01 -0700)]
pimd: Remove the api from .h file since there is no definition of it

Removing the api pim_scan_individual_oil from .h since there is
no definition of it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agodocker: use Alpine-provided libyang
Quentin Young [Sun, 17 Jul 2022 23:10:45 +0000 (19:10 -0400)]
docker: use Alpine-provided libyang

looks like libyang(2) is back in the upstream alpine repos, so we can
use that instead

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agoalpine, docker: Update APKBUILD for libyang
Quentin Young [Sun, 17 Jul 2022 21:37:14 +0000 (17:37 -0400)]
alpine, docker: Update APKBUILD for libyang

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agoMerge pull request #11622 from donaldsharp/valgrind_issues
Donatas Abraitis [Sun, 17 Jul 2022 18:58:48 +0000 (21:58 +0300)]
Merge pull request #11622 from donaldsharp/valgrind_issues

Valgrind issues

2 years agoMerge pull request #11605 from LabNConsulting/improve-valgrind
Donald Sharp [Sun, 17 Jul 2022 01:13:54 +0000 (21:13 -0400)]
Merge pull request #11605 from LabNConsulting/improve-valgrind

Improve valgrind

2 years agoMerge pull request #11610 from opensourcerouting/fix/treat-as-withdraw_otc
Donald Sharp [Sun, 17 Jul 2022 00:59:32 +0000 (20:59 -0400)]
Merge pull request #11610 from opensourcerouting/fix/treat-as-withdraw_otc

bgpd: OTC attribute should be treated as withdrawal

2 years agozebra: Delete the malloced memory under `show zebra`
Donald Sharp [Sat, 16 Jul 2022 23:01:12 +0000 (19:01 -0400)]
zebra: Delete the malloced memory under `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: When deleting nexthop group entries ensure the thread is off
Donald Sharp [Sat, 16 Jul 2022 23:00:43 +0000 (19:00 -0400)]
zebra: When deleting nexthop group entries ensure the thread is off

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Prevent Uninitialized usage of data
Donald Sharp [Sat, 16 Jul 2022 22:59:51 +0000 (18:59 -0400)]
lib: Prevent Uninitialized usage of data

Valgrind is reporting that prefix is being used uninitialized.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11615 from opensourcerouting/fix/memory_leak_for_community
Jafar Al-Gharaibeh [Sat, 16 Jul 2022 21:03:51 +0000 (16:03 -0500)]
Merge pull request #11615 from opensourcerouting/fix/memory_leak_for_community

bgpd: Fix memory leak for community stuff

2 years agoMerge pull request #11604 from LabNConsulting/working/lb/ospf-parallel-nets
Jafar Al-Gharaibeh [Sat, 16 Jul 2022 20:52:06 +0000 (15:52 -0500)]
Merge pull request #11604 from LabNConsulting/working/lb/ospf-parallel-nets

ospfd: free unreachable router LSA node so that it is not left unreachable

2 years agoMerge pull request #11614 from opensourcerouting/fix/memory_leak_community_alias
Jafar Al-Gharaibeh [Sat, 16 Jul 2022 20:51:48 +0000 (15:51 -0500)]
Merge pull request #11614 from opensourcerouting/fix/memory_leak_community_alias

bgpd: Fix memory leak for community alias

2 years agoospfd: free unreachable router LSA node so that it is not left unreachable
Lou Berger [Thu, 14 Jul 2022 11:40:39 +0000 (07:40 -0400)]
ospfd: free unreachable router LSA node so that it is not left unreachable

       allows for an LSA to be unreachable via one link and reachable via another

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agobgpd: Fix memory leak for community stuff
Donatas Abraitis [Sat, 16 Jul 2022 13:26:13 +0000 (16:26 +0300)]
bgpd: Fix memory leak for community stuff

Do not forget to cleanup after we are done:

==395247== 8,268 (32 direct, 8,236 indirect) bytes in 1 blocks are definitely lost in loss record 199 of 205
==395247==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==395247==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x1FBF63: community_intern (in /usr/lib/frr/bgpd)
==395247==    by 0x1FC0C5: community_parse (in /usr/lib/frr/bgpd)
==395247==    by 0x1F0B66: bgp_attr_community (in /usr/lib/frr/bgpd)
==395247==    by 0x1F4185: bgp_attr_parse (in /usr/lib/frr/bgpd)
==395247==    by 0x26BC29: bgp_update_receive (in /usr/lib/frr/bgpd)
==395247==    by 0x26E887: bgp_process_packet (in /usr/lib/frr/bgpd)
==395247==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Fix memory leak for community alias
Donatas Abraitis [Sat, 16 Jul 2022 13:18:07 +0000 (16:18 +0300)]
bgpd: Fix memory leak for community alias

==361630== 24,780 (96 direct, 24,684 indirect) bytes in 3 blocks are definitely lost in loss record 94 of 97
==361630==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==361630==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1FD3CC: bgp_ca_alias_insert (in /usr/lib/frr/bgpd)
==361630==    by 0x2CF8E5: bgp_community_alias_magic (in /usr/lib/frr/bgpd)
==361630==    by 0x2C980B: bgp_community_alias (in /usr/lib/frr/bgpd)
==361630==    by 0x48E3556: cmd_execute_command_real (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E384B: cmd_execute_command_strict (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3D41: command_config_read_one_line (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3EBA: config_from_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x499065C: vty_read_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4990FF4: vty_read_config (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491CB95: frr_config_read_in (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)
==361630==
==361630== 24,780 (96 direct, 24,684 indirect) bytes in 3 blocks are definitely lost in loss record 95 of 97
==361630==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==361630==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1FD39C: bgp_ca_community_insert (in /usr/lib/frr/bgpd)
==361630==    by 0x2CF8F4: bgp_community_alias_magic (in /usr/lib/frr/bgpd)
==361630==    by 0x2C980B: bgp_community_alias (in /usr/lib/frr/bgpd)
==361630==    by 0x48E3556: cmd_execute_command_real (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E384B: cmd_execute_command_strict (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3D41: command_config_read_one_line (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3EBA: config_from_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x499065C: vty_read_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4990FF4: vty_read_config (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491CB95: frr_config_read_in (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11564 from kuldeepkash/multicast_pim_bsm
Jafar Al-Gharaibeh [Fri, 15 Jul 2022 21:01:13 +0000 (16:01 -0500)]
Merge pull request #11564 from kuldeepkash/multicast_pim_bsm

tests: Fix multicast_pim_bsm_topo2 static route issue

2 years agobgpd: OTC attribute should be treated as withdrawal
Donatas Abraitis [Thu, 14 Jul 2022 20:44:27 +0000 (23:44 +0300)]
bgpd: OTC attribute should be treated as withdrawal

According to RFC9234:

An UPDATE message with a malformed OTC Attribute SHALL be handled
   using the approach of "treat-as-withdraw".

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11606 from LabNConsulting/zebra-nbr-memleak
Jafar Al-Gharaibeh [Thu, 14 Jul 2022 20:04:22 +0000 (15:04 -0500)]
Merge pull request #11606 from LabNConsulting/zebra-nbr-memleak

zebra: free neighbor state before exit to avoid memleaks

2 years agoMerge pull request #11603 from Chromico/master
Donatas Abraitis [Thu, 14 Jul 2022 19:01:51 +0000 (22:01 +0300)]
Merge pull request #11603 from Chromico/master

topotests: Remove typo (extra dot on the IP)

2 years agoMerge pull request #11536 from mobash-rasool/temp1
Jafar Al-Gharaibeh [Thu, 14 Jul 2022 17:24:35 +0000 (12:24 -0500)]
Merge pull request #11536 from mobash-rasool/temp1

pimd: During prune pending, behave as NOINFO state (conformance issue)

2 years agotests: analyze: handle list of strings being returned
Christian Hopps [Thu, 14 Jul 2022 16:04:15 +0000 (12:04 -0400)]
tests: analyze: handle list of strings being returned

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agotests: check memleaks end of module and ignore daemonizing parent
Christian Hopps [Thu, 14 Jul 2022 15:33:39 +0000 (11:33 -0400)]
tests: check memleaks end of module and ignore daemonizing parent

- ignore parent from daemonize valgrind files these allocations will be
checked in the child.
- check for memleaks at end of module/file not just after tests.

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agozebra: free neighbor state before exit to avoid memleaks
Christian Hopps [Thu, 14 Jul 2022 16:20:01 +0000 (12:20 -0400)]
zebra: free neighbor state before exit to avoid memleaks

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agotopotests: Remove typo on IP
Chromico Rek [Thu, 14 Jul 2022 10:10:45 +0000 (14:10 +0400)]
topotests: Remove typo on IP

Signed-off-by: Nathan Mangar <nathan@thundergear.io>
topotests: Remove static route

Signed-off-by: Nathan Mangar <nathan@thundergear.io>
2 years agobmp: add L3VPN support
Francois Dumontet [Mon, 16 May 2022 11:44:06 +0000 (13:44 +0200)]
bmp: add L3VPN support

Support for BMP L3VPN monitoring messages through SAFI_MPLS_VPN address
family.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2 years agoMerge pull request #11598 from patrasar/pim_get_instance
David Lamparter [Wed, 13 Jul 2022 14:54:39 +0000 (16:54 +0200)]
Merge pull request #11598 from patrasar/pim_get_instance

2 years agoMerge pull request #11585 from patrasar/sg_str
David Lamparter [Wed, 13 Jul 2022 14:51:10 +0000 (16:51 +0200)]
Merge pull request #11585 from patrasar/sg_str

2 years agoMerge pull request #11593 from mobash-rasool/fixes
David Lamparter [Wed, 13 Jul 2022 14:49:27 +0000 (16:49 +0200)]
Merge pull request #11593 from mobash-rasool/fixes

2 years agoMerge pull request #11597 from opensourcerouting/pimd-packed-member
mobash-rasool [Wed, 13 Jul 2022 11:59:30 +0000 (17:29 +0530)]
Merge pull request #11597 from opensourcerouting/pimd-packed-member

pimd: fix unaligned accesses

2 years agopimd,pim6d: Set RP to true if the address matches, ignore prefix-length
Mobashshera Rasool [Tue, 12 Jul 2022 08:11:12 +0000 (01:11 -0700)]
pimd,pim6d: Set RP to true if the address matches, ignore prefix-length

The API pim_rp_check_interface_addrs checks if the RP address matches
with the primary address then it returns true.
In case of PIMv4 this condition is true, therefore the router becomes RP.
But in case of PIMv6, this condition does not pass because primary address
for PIMv6 is link-local address.

Also PIMv4 allows secondary addresses to be used as RP
if it is a host route in case primary does not match.

Fixing it by only checking the configured
RP address with the interface address and ignoring the prefix
length since it does not matter.

Fixes: #11335
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #11576 from anlancs/fix/minor-5
mobash-rasool [Wed, 13 Jul 2022 04:12:07 +0000 (09:42 +0530)]
Merge pull request #11576 from anlancs/fix/minor-5

zebra: remove redundant flags assignment

2 years agozebra: remove redundant flags assignment
anlan_cs [Fri, 8 Jul 2022 21:38:26 +0000 (17:38 -0400)]
zebra: remove redundant flags assignment

The assignment of neigh flags on ES peers is set twice. Just clean it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #11566 from louis-6wind/rename-mplsvpn
Donatas Abraitis [Tue, 12 Jul 2022 16:09:32 +0000 (19:09 +0300)]
Merge pull request #11566 from louis-6wind/rename-mplsvpn

bgpd: rename "struct bgp" variables in mplsvpn and cleanup

2 years agoMerge pull request #11572 from opensourcerouting/fix/avoid_double_quotes_when_cat
Jafar Al-Gharaibeh [Tue, 12 Jul 2022 15:55:23 +0000 (09:55 -0600)]
Merge pull request #11572 from opensourcerouting/fix/avoid_double_quotes_when_cat

tools: Do not wrap the pidfile into double-quotes for frrcommon.sh

2 years agoMerge pull request #11461 from mobash-rasool/pimv6-enable
Mark Stapp [Tue, 12 Jul 2022 15:44:29 +0000 (11:44 -0400)]
Merge pull request #11461 from mobash-rasool/pimv6-enable

pim6d: Enable/disable pim6d daemons on different platforms based on flags

2 years agoMerge pull request #11285 from iqras23/conditional_def_orig
David Lamparter [Tue, 12 Jul 2022 15:41:09 +0000 (17:41 +0200)]
Merge pull request #11285 from iqras23/conditional_def_orig

2 years agoMerge pull request #11577 from opensourcerouting/fix/memory_leak_bgp_gr_notification
Russ White [Tue, 12 Jul 2022 14:23:01 +0000 (10:23 -0400)]
Merge pull request #11577 from opensourcerouting/fix/memory_leak_bgp_gr_notification

bgpd: Free ->raw_data from Hard Notification message after we use it

2 years agopimd: Remove pim_get_pim_instance defination in pim_cmd_common.h
Sarita Patra [Tue, 12 Jul 2022 13:01:50 +0000 (06:01 -0700)]
pimd: Remove pim_get_pim_instance defination in pim_cmd_common.h

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopimd: Avoid unnecessary vrf lookup
Sarita Patra [Tue, 12 Jul 2022 13:00:57 +0000 (06:00 -0700)]
pimd: Avoid unnecessary vrf lookup

In several places, we are getting the vrf structure using
vrf_lookup_by_name(). Again we are passing vrf->vrf_id to
pim_get_pim_instance() to get the pim_instance.

The API pim_get_pim_instance() again get the VRF structure using
vrf_lookup_by_id(). This is avoided in this PR.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Longest possible length of a (S,G) string is 94 bytes
Sarita Patra [Mon, 11 Jul 2022 11:58:45 +0000 (04:58 -0700)]
pim6d: Longest possible length of a (S,G) string is 94 bytes

Longest possible length of a IPV6 (S,G) string is 94 bytes
INET6_ADDRSTRLEN * 2 = 46 * 2
(,) = 1
NULL Character at end = 1

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopimd: Fix description for PIM_SG_LEN
Sarita Patra [Mon, 11 Jul 2022 11:56:29 +0000 (04:56 -0700)]
pimd: Fix description for PIM_SG_LEN

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agoMerge pull request #11580 from patrasar/remove_pim_addr.h
David Lamparter [Tue, 12 Jul 2022 10:55:42 +0000 (12:55 +0200)]
Merge pull request #11580 from patrasar/remove_pim_addr.h

pimd: removal double inclusion of pim_addr.h

2 years agopimd: fix unaligned accesses
David Lamparter [Tue, 12 Jul 2022 10:47:46 +0000 (12:47 +0200)]
pimd: fix unaligned accesses

These are in packed structs at weird offsets (e.g. 2 bytes), and as such
need a memcpy to get them into proper alignment.

It'd be even better if the pimd code used proper de/serialization, but
let's get this improved one step at a time.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #11588 from opensourcerouting/fix/babeld_missing_routes
Jafar Al-Gharaibeh [Tue, 12 Jul 2022 06:15:47 +0000 (00:15 -0600)]
Merge pull request #11588 from opensourcerouting/fix/babeld_missing_routes

babeld: Install route to RIB if parse_update_subtlv() is false

2 years agobabeld: Install route to RIB if parse_update_subtlv() is false
Donatas Abraitis [Mon, 11 Jul 2022 17:26:06 +0000 (20:26 +0300)]
babeld: Install route to RIB if parse_update_subtlv() is false

We installed the route only if the type was SUBTLV_MANDATORY.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11583 from mobash-rasool/fixes
Donatas Abraitis [Mon, 11 Jul 2022 16:40:06 +0000 (19:40 +0300)]
Merge pull request #11583 from mobash-rasool/fixes

pimd: Correct the order of show json for interface traffic

2 years agobgpd: fix wrong nexthop bgp struct for nexthop validation
Louis Scalbert [Thu, 5 May 2022 16:46:35 +0000 (18:46 +0200)]
bgpd: fix wrong nexthop bgp struct for nexthop validation

The bgp_nexthop must be the source bgp structure. It cannot be the
destination bgp one.

Use bgp_orig source bgp struct by default.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: rename "struct bgp" variables in mplsvpn
Louis Scalbert [Fri, 8 Jul 2022 10:37:57 +0000 (12:37 +0200)]
bgpd: rename "struct bgp" variables in mplsvpn

The "struct bgp" variable names in the mplsvpn bgp code do not
explicitly say whether they refer to a source or destination BGP
instance. Some variable declarations are commented out with "from" and
"to" but this does not avoid confusion within the functions. The names
of "struct bgp" variables are reused in different functions but their
names sometimes refer to a source instance and sometimes to a
destination instance.

Rename the "struct bgp" variable names to from_bgp and to_bgp.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: remove duplicated arg in leak_update
Louis Scalbert [Thu, 5 May 2022 12:19:53 +0000 (14:19 +0200)]
bgpd: remove duplicated arg in leak_update

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agopimd: removal double inclusion of pim_addr.h
Sarita Patra [Mon, 11 Jul 2022 08:26:24 +0000 (01:26 -0700)]
pimd: removal double inclusion of pim_addr.h

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agotools: Do not wrap the pidfile into double-quotes for frrcommon.sh
Donatas Abraitis [Fri, 8 Jul 2022 16:11:17 +0000 (19:11 +0300)]
tools: Do not wrap the pidfile into double-quotes for frrcommon.sh

The problem is that when we run watchfrr.sh/frrinit.sh, we get something like:

```
cat: '"/var/run/frr/staticd.pid"': No such file or directory
cat: '"/var/run/frr/babeld.pid"': No such file or directory
cat: '"/var/run/frr/zebra.pid"': No such file or directory
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Free ->raw_data from Hard Notification message after we use it
Donatas Abraitis [Sun, 10 Jul 2022 09:42:46 +0000 (12:42 +0300)]
bgpd: Free ->raw_data from Hard Notification message after we use it

==175785== 0 bytes in 1 blocks are definitely lost in loss record 1 of 88
==175785==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==175785==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==175785==    by 0x269823: bgp_notify_decapsulate_hard_reset (in /usr/lib/frr/bgpd)
==175785==    by 0x26C85D: bgp_notify_receive (in /usr/lib/frr/bgpd)
==175785==    by 0x26E94E: bgp_process_packet (in /usr/lib/frr/bgpd)
==175785==    by 0x4985349: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==175785==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==175785==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)
==175785==

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agopimd: Correct the order of show json for interface traffic
Mobashshera Rasool [Mon, 11 Jul 2022 11:13:29 +0000 (04:13 -0700)]
pimd: Correct the order of show json for interface traffic

"show ip pim interface traffic json" shows pruneTx first and then
pruneRx stats
where as
"show ip pim interface <ifname> json" shows pruneRx first and then
pruneTx stats.

Although the values are right but the display looks odd.

Making it same as other stats, first display Rx and then Tx.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #11579 from opensourcerouting/fix/revert_isis_fast_reroute
Mark Stapp [Mon, 11 Jul 2022 11:37:00 +0000 (07:37 -0400)]
Merge pull request #11579 from opensourcerouting/fix/revert_isis_fast_reroute

isisd: Revert fast-reroute recent changes

2 years agotests: Fix multicast_pim_bsm_topo2 static route issue
Kuldeep Kashyap [Thu, 7 Jul 2022 21:44:28 +0000 (14:44 -0700)]
tests: Fix multicast_pim_bsm_topo2 static route issue

API to verify static route was checking whether
router is installed with expected nexthop. In
this particular scenario we has same route as
Connected and Static both. In heavy loaded
system static routes was taking time to get
installed and API was doing the verification
on Connected route instead Static route.
Enhanced scripts to check only static routes.

Issue: https://github.com/FRRouting/frr/issues/11563

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agoRevert "isisd: apply fast-reroute on an adjacency failure"
Donatas Abraitis [Sun, 10 Jul 2022 18:41:25 +0000 (21:41 +0300)]
Revert "isisd: apply fast-reroute on an adjacency failure"

This reverts commit 71252973234e70ffa3cb5eec43d4efc1be3d3331.

2 years agoRevert "isisd: remove previous labels before fast-reroute"
Donatas Abraitis [Sun, 10 Jul 2022 18:41:21 +0000 (21:41 +0300)]
Revert "isisd: remove previous labels before fast-reroute"

This reverts commit a254fa54e3d5c31befb40164fc70deab3cf639ad.

2 years agoRevert "isisd: allow nexthop lookup on interface only"
Donatas Abraitis [Sun, 10 Jul 2022 18:41:17 +0000 (21:41 +0300)]
Revert "isisd: allow nexthop lookup on interface only"

This reverts commit a11742dc53e31d1379cb4f7b9b7b750614e30928.

2 years agoRevert "isisd: apply fast-reroute when an interface falls down"
Donatas Abraitis [Sun, 10 Jul 2022 18:41:12 +0000 (21:41 +0300)]
Revert "isisd: apply fast-reroute when an interface falls down"

This reverts commit 62e458278b3d261f492ffeac7ed70b32272a43dd.

2 years agoRevert "isisd: avoid fast-reroute on down adjacency when the interface is down"
Donatas Abraitis [Sun, 10 Jul 2022 18:41:07 +0000 (21:41 +0300)]
Revert "isisd: avoid fast-reroute on down adjacency when the interface is down"

This reverts commit 08e4960ab48c1c9e4227e40b286d5cbc4ac581f0.

2 years agoRevert "isisd: avoid fast-reroute from running twice on a down interface event"
Donatas Abraitis [Sun, 10 Jul 2022 18:41:02 +0000 (21:41 +0300)]
Revert "isisd: avoid fast-reroute from running twice on a down interface event"

This reverts commit d526476184999275c318b13f92ae6b38a0250052.

2 years agoRevert "topotests: isis-tilfa add a switchover test after linkdown"
Donatas Abraitis [Sun, 10 Jul 2022 18:40:55 +0000 (21:40 +0300)]
Revert "topotests: isis-tilfa add a switchover test after linkdown"

This reverts commit bac0d1e6068ae46502bd5b348765faea554ebf72.

2 years agoRevert "topotests: isis-tilfa add a switchover test after BFD down"
Donatas Abraitis [Sun, 10 Jul 2022 18:40:49 +0000 (21:40 +0300)]
Revert "topotests: isis-tilfa add a switchover test after BFD down"

This reverts commit e83a52698b31fde2532b4a5a8c5223ba5e858ef2.

2 years agoRevert "isisd: fix metric calculation of classic lfa backup prefixes"
Donatas Abraitis [Sun, 10 Jul 2022 18:40:43 +0000 (21:40 +0300)]
Revert "isisd: fix metric calculation of classic lfa backup prefixes"

This reverts commit e45958e9cfccd6dfc108a7ef5cb73775e8ef2e68.

2 years agoRevert "isisd: fix SPF scheduling on IPv6 only topology"
Donatas Abraitis [Sun, 10 Jul 2022 18:40:32 +0000 (21:40 +0300)]
Revert "isisd: fix SPF scheduling on IPv6 only topology"

This reverts commit d95cd33545006004424736d20a0226b5cd9fb47a.

2 years agoRevert "topotests: isis-lfa add a switchover test after linkdown"
Donatas Abraitis [Sun, 10 Jul 2022 18:40:16 +0000 (21:40 +0300)]
Revert "topotests: isis-lfa add a switchover test after linkdown"

This reverts commit 5558ac984fa3adc5beb66a1945ad169705a28a37.

2 years agoRevert "topotests: isis-lfa add a switchover test after hello timeout"
Donatas Abraitis [Sun, 10 Jul 2022 18:40:11 +0000 (21:40 +0300)]
Revert "topotests: isis-lfa add a switchover test after hello timeout"

This reverts commit c99ef489629ffa057b312756771693e417309995.

2 years agoRevert "topotests: isis-lfa add a switchover test after neighbor clear"
Donatas Abraitis [Sun, 10 Jul 2022 18:40:05 +0000 (21:40 +0300)]
Revert "topotests: isis-lfa add a switchover test after neighbor clear"

This reverts commit 9cdc099bb5d1fa0c3949847759469bfc444a885c.

2 years agoRevert "topotests: isis-lfa add a switchover test after BFD down"
Donatas Abraitis [Sun, 10 Jul 2022 18:39:59 +0000 (21:39 +0300)]
Revert "topotests: isis-lfa add a switchover test after BFD down"

This reverts commit c8d2816ee5245ac2a13cbb36299f2f0c23f226e3.

2 years agoMerge pull request #11570 from opensourcerouting/pim6-bsr-clear
mobash-rasool [Sat, 9 Jul 2022 04:19:36 +0000 (09:49 +0530)]
Merge pull request #11570 from opensourcerouting/pim6-bsr-clear

pim6d: add `clear ipv6 pim bsr-data`

2 years agoMerge pull request #11569 from opensourcerouting/gcc-plugin-shortcomings-220708
Donald Sharp [Sat, 9 Jul 2022 01:30:54 +0000 (21:30 -0400)]
Merge pull request #11569 from opensourcerouting/gcc-plugin-shortcomings-220708

bgpd: work around GCC/plugin shortcomings

2 years agoMerge pull request #11568 from anlancs/fix/minor-4
Donatas Abraitis [Fri, 8 Jul 2022 19:16:28 +0000 (22:16 +0300)]
Merge pull request #11568 from anlancs/fix/minor-4

bgpd: fix missing rmac value in debug

2 years agoMerge pull request #10962 from louis-6wind/lfa-netlink
Russ White [Fri, 8 Jul 2022 15:14:07 +0000 (11:14 -0400)]
Merge pull request #10962 from louis-6wind/lfa-netlink

isisd: apply fast-reroute as soon an interface or an adjacency falls down

2 years agopim6d: add `clear ipv6 pim bsr-data`
David Lamparter [Fri, 6 May 2022 08:28:52 +0000 (10:28 +0200)]
pim6d: add `clear ipv6 pim bsr-data`

This is needed for ANVL between testruns, and already in IPv4 too.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: work around GCC/plugin shortcomings
David Lamparter [Fri, 8 Jul 2022 11:59:10 +0000 (13:59 +0200)]
bgpd: work around GCC/plugin shortcomings

The GCC extended printf format checking plugin runs into some GCC
shortcomings regarding casts on printf function parameters.  While this
can be fixed with a small GCC patch, patching GCC is "nontrivial" to say
the least.  Luckily, it happens that this is /almost/ not an issue for
the FRR source base.

Since we fix SA "misunderstandings" too, let's just fix places where the
format checking plugin runs into this limitation to keep things working
extra smoothly.

(It's not a huge effort either, these two spots in bgpd are the only
places that trigger the plugin limitation, and it's been "clean" before
that for more than a year if my memory is right.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: show prefix in leak_update_nexthop_valid debug
Louis Scalbert [Wed, 27 Apr 2022 15:52:38 +0000 (17:52 +0200)]
bgpd: show prefix in leak_update_nexthop_valid debug

Add prefix information in a leak_update_nexthop_valid() debug log.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: fix setting BGP_PATH_VALID flag in leak_update
Louis Scalbert [Thu, 28 Apr 2022 15:00:50 +0000 (17:00 +0200)]
bgpd: fix setting BGP_PATH_VALID flag in leak_update

(Un)set the BGP_PATH_VALID flag appropriately in the leak_update
function.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: factorize nexthop validation code in leak_update function
Louis Scalbert [Wed, 27 Apr 2022 12:15:13 +0000 (14:15 +0200)]
bgpd: factorize nexthop validation code in leak_update function

Factorize some duplicated codes about nexthop validation in the
leak_update function.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agoMerge pull request #10592 from patrasar/master_pimv6_bsm
David Lamparter [Fri, 8 Jul 2022 08:46:35 +0000 (10:46 +0200)]
Merge pull request #10592 from patrasar/master_pimv6_bsm

2 years agoMerge pull request #11553 from patrasar/clear_ip_mroute
Donatas Abraitis [Fri, 8 Jul 2022 06:50:44 +0000 (09:50 +0300)]
Merge pull request #11553 from patrasar/clear_ip_mroute

pimd, pim6d: Fix description for clear ip[v6] mroute command

2 years agobgpd: fix missing rmac value in debug
anlan_cs [Fri, 8 Jul 2022 04:09:56 +0000 (00:09 -0400)]
bgpd: fix missing rmac value in debug

`attr.rmac` is not set in debug as expected for its wrong place in code.

Just move the debug process (`bgp_debug_zebra(NULL)`) after possible `rmac`
value is set.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agopim6d: removed pim6_stubs.c file
sarita patra [Thu, 5 May 2022 08:04:19 +0000 (01:04 -0700)]
pim6d: removed pim6_stubs.c file

pim6_stub.c file is no more needed.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: Adjust pim_show_bsm_db for IPV6
sarita patra [Wed, 4 May 2022 14:11:35 +0000 (07:11 -0700)]
pim6d: Adjust pim_show_bsm_db for IPV6

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: IPV6 adjust in hash_calc_on_grp_rp
sarita patra [Wed, 27 Apr 2022 11:17:48 +0000 (04:17 -0700)]
pim6d: IPV6 adjust in hash_calc_on_grp_rp

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoRevert "pim6d: IPv6-adjust BSM code"
sarita patra [Wed, 27 Apr 2022 10:43:55 +0000 (03:43 -0700)]
Revert "pim6d: IPv6-adjust BSM code"

This reverts commit 809c11a9d87e0d12a5c3d3ca6906bc398a58de6c.

2 years agopim6d: remove unused variable neigh_src_str
sarita patra [Wed, 27 Apr 2022 10:27:24 +0000 (03:27 -0700)]
pim6d: remove unused variable neigh_src_str

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: running pim_bsm.c for pimv6
sarita patra [Wed, 16 Mar 2022 11:57:12 +0000 (04:57 -0700)]
pim6d: running pim_bsm.c for pimv6

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: add pimv6 support for bsmmsg_grpinfo
sarita patra [Wed, 16 Mar 2022 10:17:06 +0000 (03:17 -0700)]
pim6d: add pimv6 support for bsmmsg_grpinfo

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: add pimv6 support for bsmmsg_rpinfo
sarita patra [Wed, 16 Mar 2022 10:08:53 +0000 (03:08 -0700)]
pim6d: add pimv6 support for bsmmsg_rpinfo

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: add pimv6 support for bsm_hdr
sarita patra [Tue, 1 Mar 2022 21:38:01 +0000 (13:38 -0800)]
pim6d: add pimv6 support for bsm_hdr

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: Add pim_addr rp_addr in bsm_rpinfo
sarita patra [Wed, 16 Feb 2022 12:09:23 +0000 (04:09 -0800)]
pim6d: Add pim_addr rp_addr in bsm_rpinfo

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoMerge pull request #11541 from opensourcerouting/zebra-mr-netlink
Donald Sharp [Thu, 7 Jul 2022 16:23:07 +0000 (12:23 -0400)]
Merge pull request #11541 from opensourcerouting/zebra-mr-netlink

zebra: fix various multicast routing netlink API bits

2 years agoMerge pull request #11545 from opensourcerouting/fix/memory_leak_for_bmp_listener
Donald Sharp [Thu, 7 Jul 2022 16:22:19 +0000 (12:22 -0400)]
Merge pull request #11545 from opensourcerouting/fix/memory_leak_for_bmp_listener

bgpd: Free memory for BMP listeners when deleting BGP instance

2 years agoMerge pull request #11549 from opensourcerouting/fix/logrotate
Jafar Al-Gharaibeh [Thu, 7 Jul 2022 14:56:34 +0000 (08:56 -0600)]
Merge pull request #11549 from opensourcerouting/fix/logrotate

tools: Add missing bfdd to logrotate config

2 years agopim6d: bsr nht handling for IPV6
sarita patra [Wed, 16 Feb 2022 11:45:34 +0000 (03:45 -0800)]
pim6d: bsr nht handling for IPV6

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: modify in_addr current_bsr to pim_addr current_bsr
sarita patra [Wed, 16 Feb 2022 11:43:07 +0000 (03:43 -0800)]
pim6d: modify in_addr current_bsr to pim_addr current_bsr

Signed-off-by: sarita patra <saritap@vmware.com>