Commit Graph

30591 Commits

Author SHA1 Message Date
Xiao Liang
a783cc05f0 bgpd: Handle route-refresh request received before EoR
See the BGP message sequence:

    R1                  R2
    |      updates      |
    |------------------>|
    |                   |
    |  refresh request  |
    x<------------------|
    |                   |
    |   updates cont.   |
    |------------------>|
    |                   |
    |    end-of-rib     |
    |------------------>|
    |                   |

When R1 and R2 establish BGP session, R1 begins to send initial updates.
If R2 sends a route-refresh request before EoR, it's silently ignored
by R1, and routes received earlier have no chance to be processed again.

RFC7313 says, "for a BGP speaker that supports the BGP Graceful Restart,
it MUST NOT send a BoRR for an <AFI, SAFI> to a neighbor before it sends
the EoR for the <AFI, SAFI> to the neighbor." But it doesn't forbid
route-refresh request to be sent before receiving EoR.

To handle this scenario, postpone response to refresh request until EoR
is sent.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2022-09-16 18:26:21 +08:00
Mobashshera Rasool
5784a87811 pim6d: Fixing coverity issues for pim6_mld.c
CID 1519843 (#2 of 2): Uninitialized scalar variable (UNINIT)
43. uninit_use_in_call: Using uninitialized value pkt_src->sin6_addr when calling gm_rx_process

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-09-16 03:12:13 -07:00
Donatas Abraitis
df6a97a643 bgpd: Free ecommunity before returning on warning/error
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-16 13:11:21 +03:00
Abhishek N R
5eac8aa3fb pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim state" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-16 02:39:47 -07:00
Abhishek N R
b4460a6b33 pim6d: (*,G) mroutes not learnt after pim6d daemon restart
After restart pim dr address was zero due to which pim (*,G) join
could not get propagated towards RP.

While trying to find primary address ll_highest will be zero initially,
since we have not received address from zebra yet.

So we can get the best address at this point and use it as primary address
whenever ll_highest is zero.

Fixes: #11925

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-16 00:42:39 -07:00
Sarita Patra
e309780f12 pim6d: fix clear ipv6 mroute crash
Root Cause:
"clear ipv6 mroute" was not deleting the subscribers of gm_if
structure.

Fix:
The command "clear ipv6 mroute" deletes grp_pends, gsq_pends, sgs,
subscribers, expires of gm_if data structure.

Deleted the common code in gm_ifp_teardown() and called
gm_group_delete().

Issue: #11724

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-09-15 20:32:49 -07:00
anlan_cs
924eb45a46 include: clean up some white spaces
Found some extra spaces, clean up them with uniform format.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-09-15 22:41:13 -04:00
Donatas Abraitis
a05ae6c440
Merge pull request #11949 from donaldsharp/plist_deletion_failure
lib: Fix skip of every other plist deletion
2022-09-15 11:32:37 -07:00
Donald Sharp
48eb0dedfa
Merge pull request #11948 from mobash-rasool/fixes3
pimd: Fix memleak in bfd profile
2022-09-15 08:04:57 -04:00
sri-mohan1
6751c0f328 zebra: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-09-15 14:18:48 +05:30
Donald Sharp
6bae02045b lib: Fix skip of every other plist deletion
When bulk deleting prefix lists on shutdown the code
was calling plist_delete, which removed the item
from the master->str list, and then popping the next
item on the list and just dropping it on the floor.
The pop is not needed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-14 13:48:31 -04:00
Mobashshera Rasool
2ce3c8ec58 pimd: Fix memleak in bfd profile
In function pim_if_delete, pim_ifp->bfd_config.profile needs to be
freed.
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-09-14 10:34:10 -07:00
Donald Sharp
0f926d9141
Merge pull request #11946 from AbhishekNR/debug_igmp_gm
pimd, pim6d: Changing IGMP to GM in debug macros.
2022-09-14 09:40:25 -04:00
Abhishek N R
a96d64b0d6 pimd, pim6d: Changing IGMP to GM in debug macros.
Changed PIM_DEBUG_IGMP_TRACE to PIM_DEBUG_GM_TRACE and
PIM_DEBUG_IGMP_TRACE_DETAIL to PIM_DEBUG_GM_TRACE_DETAIL.
Hence, these macros can be used for both v6 and v4.

Issue: #11895

Co-authored-by: Sai Gomathi N <nsaigomathi@vmware.com>
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-13 23:29:33 -07:00
Sarita Patra
ad56b07c09 pim6d: fix "show ipv6 mld interface" command
Issue:
=====
frr# show ipv6 mld
  interface   All VRFs

Fix:
===
frr# show ipv6 mld
  interface   MLD interface information

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-09-13 20:36:07 -07:00
Russ White
7fa5e07b1c
Merge pull request #11899 from opensourcerouting/feature/route_validation_extended_community
bgpd: Implement Origin Validation State via extended communities
2022-09-13 11:30:54 -04:00
Donatas Abraitis
c3c5f18c2b
Merge pull request #11926 from mjstapp/fix_bgp_io_race
bgpd: avoid notify race between io and main pthreads
2022-09-12 18:24:18 +02:00
Donald Sharp
71d987dbb9
Merge pull request #11868 from LabNConsulting/ziemba/bgp-labelpool-performance
bgpd: improve labelpool performance at scale
2022-09-12 10:45:43 -04:00
Donald Sharp
ed11f561bc
Merge pull request #11923 from opensourcerouting/fix/aggregate-address-matching-MED
bgpd: Fix aggregate-address summary-only matching-MED-only
2022-09-12 10:31:01 -04:00
Donald Sharp
1996217997
Merge pull request #11930 from opensourcerouting/fix/bgp_remove_private_as_test
tests: Validate the routes using polling for bgp_remove_private_as
2022-09-12 09:56:59 -04:00
Donald Sharp
d31bf91e76
Merge pull request #11929 from opensourcerouting/fix/memory_leaks
bgpd: Fix memory leak for `set as-path replace` route-map command
2022-09-12 09:56:01 -04:00
Donald Sharp
9e52401574
Merge pull request #11932 from opensourcerouting/fix/memory_leak_bgp_soo_ecommunity_dup
bgpd: Fix memory leak for `conf_copy()` - SoO ecommunity
2022-09-12 09:55:14 -04:00
Donald Sharp
c8a02cf27c
Merge pull request #11928 from opensourcerouting/fix/memory_leak_bgp_soo
bgpd: Fix memory leak for `as-override`
2022-09-12 09:54:53 -04:00
Donald Sharp
edbc06dbe7
Merge pull request #11933 from opensourcerouting/fix/nits
bgpd, lib: Random cleanup
2022-09-12 09:54:07 -04:00
Donald Sharp
0aa6fc86f2
Merge pull request #11934 from sri-mohan1/sri-eigrp-dbg1
eigrpd: changes for code maintainability
2022-09-12 09:53:31 -04:00
sri-mohan1
04b267e4e5 eigrpd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-09-12 13:34:01 +05:30
Donatas Abraitis
918f64980a bgpd: Thread is already done, drop useless assignment t_rmap_update to NULL
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-12 04:42:41 +03:00
Donatas Abraitis
d3822e7983 lib: Replace route_map_clear_updated to void
Return status not used at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-12 04:42:41 +03:00
Donatas Abraitis
9f9f3bfb62
Merge pull request #11903 from sri-mohan1/sri-bfd-dbg1
bfd: changes for code maintainability
2022-09-11 05:23:55 +02:00
Donatas Abraitis
61adcf71be bgpd: Fix memory leak for conf_copy() - SoO ecommunity
==1179738== 48 (40 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 13 of 29
==1179738==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==1179738==    by 0x493C8D5: qcalloc (memory.c:116)
==1179738==    by 0x208F0C: ecommunity_dup (bgp_ecommunity.c:267)
==1179738==    by 0x2B300C: conf_copy (bgp_updgrp.c:170)
==1179738==    by 0x2B35BF: peer2_updgrp_copy (bgp_updgrp.c:277)
==1179738==    by 0x2B5189: update_group_find (bgp_updgrp.c:826)
==1179738==    by 0x2B70D0: update_group_adjust_peer (bgp_updgrp.c:1769)
==1179738==    by 0x23DB7D: update_group_adjust_peer_afs (bgp_updgrp.h:519)
==1179738==    by 0x243B21: bgp_establish (bgp_fsm.c:2129)
==1179738==    by 0x244B94: bgp_event_update (bgp_fsm.c:2597)
==1179738==    by 0x26B0E6: bgp_process_packet (bgp_packet.c:2895)
==1179738==    by 0x498F5FD: thread_call (thread.c:2008)
==1179738==    by 0x49253DA: frr_run (libfrr.c:1198)
==1179738==    by 0x1EEC38: main (bgp_main.c:520)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-10 18:13:45 +03:00
Donatas Abraitis
bbe7bc46f1 bgpd: Fix memory leak for as-override
==536197== 400 (160 direct, 240 indirect) bytes in 4 blocks are definitely lost in loss record 19 of 21
==536197==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==536197==    by 0x491C753: qcalloc (memory.c:116)
==536197==    by 0x303FA9: aspath_dup (bgp_aspath.c:698)
==536197==    by 0x304B2A: aspath_replace_specific_asn (bgp_aspath.c:1219)
==536197==    by 0x256840: bgp_peer_as_override (bgp_route.c:1781)
==536197==    by 0x256840: subgroup_announce_check (bgp_route.c:2216)
==536197==    by 0x258345: subgroup_process_announce_selected (bgp_route.c:2804)
==536197==    by 0x27F2CA: group_announce_route_walkcb (bgp_updgrp_adv.c:199)
==536197==    by 0x4905A51: hash_walk (hash.c:285)
==536197==    by 0x27E8D1: update_group_af_walk (bgp_updgrp.c:1866)
==536197==    by 0x2809D3: group_announce_route (bgp_updgrp_adv.c:1022)
==536197==    by 0x257DC4: bgp_process_main_one (bgp_route.c:3189)
==536197==    by 0x257DC4: bgp_process_main_one (bgp_route.c:2975)
==536197==    by 0x2581F7: bgp_process_wq (bgp_route.c:3330)
==536197==    by 0x4961787: work_queue_run (workqueue.c:285)
==536197==    by 0x4957745: thread_call (thread.c:2008)
==536197==    by 0x4910B77: frr_run (libfrr.c:1198)
==536197==    by 0x1ED6AC: main (bgp_main.c:520)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-10 06:56:01 +03:00
Donatas Abraitis
7462dbb0c2 tests: Validate the routes using polling for bgp_remove_private_as
Do not fail at the first shot.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-10 06:51:25 +03:00
Donatas Abraitis
67a9da92a1 bgpd: Fix memory leak for set as-path replace route-map command
==1174993== 252 (120 direct, 132 indirect) bytes in 3 blocks are definitely lost in loss record 77 of 100
==1174993==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==1174993==    by 0x493C8D5: qcalloc (memory.c:116)
==1174993==    by 0x378E38: aspath_dup (bgp_aspath.c:698)
==1174993==    by 0x2A39E2: route_set_aspath_replace (bgp_routemap.c:2259)
==1174993==    by 0x4965C71: route_map_apply_ext (routemap.c:2664)
==1174993==    by 0x27BCC8: bgp_input_modifier (bgp_route.c:1657)
==1174993==    by 0x281AB9: bgp_update (bgp_route.c:3992)
==1174993==    by 0x286368: bgp_nlri_parse_ip (bgp_route.c:5890)
==1174993==    by 0x264D20: bgp_nlri_parse (bgp_packet.c:347)
==1174993==    by 0x2682FE: bgp_update_receive (bgp_packet.c:1921)
==1174993==    by 0x26AA67: bgp_process_packet (bgp_packet.c:2822)
==1174993==    by 0x498F5FD: thread_call (thread.c:2008)
==1174993==    by 0x49253DA: frr_run (libfrr.c:1198)
==1174993==    by 0x1EEC38: main (bgp_main.c:520)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-10 02:14:45 +03:00
Donald Sharp
db391f7d06
Merge pull request #11922 from anlancs/fix/zebra-broken-evpn
zebra: fix broken evpn
2022-09-09 07:58:29 -04:00
Donald Sharp
a50c13d4c0
Merge pull request #11909 from opensourcerouting/fix/a_couple_nits
bgpd: bgp_dest_unlock_node fixes
2022-09-09 07:55:13 -04:00
Mark Stapp
71ca5b09bc bgpd: avoid notify race between io and main pthreads
The "bgp_notify_" apis in bgp_packet.c generate a notification
to a peer, usually during error handling. The io pthread wants
to send notifications in a couple of cases during early
received-packet validation - but the existing api interacts
with the peer struct itself, and that's not safe.

Add a new api for use by the io pthread, and adjust the main
notify api so that it can avoid touching the peer struct.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-09-08 16:14:36 -04:00
Donatas Abraitis
6a26823c88
Merge pull request #11896 from AbhishekNR/issue_11891
pim6d: Adding additional details for "show ipv6 mld interface [ifname] json" command.
2022-09-08 16:35:44 +02:00
Donatas Abraitis
8a59ae5ebc
Merge pull request #11887 from SaiGomathiN/igmptogm
pimd, pim6d: Changing IGMP to GM in debug macros
2022-09-08 16:34:26 +02:00
anlan_cs
f09428e472 zebra: fix broken evpn
To resolve link dependencies of unordered interfaces, the commit
`520ebf72b27c2462ce8b0dc5a1d4cb83956df69c` has separated assignment of
`zif->link_ifindex` and `zif->link` from `netlink_interface()` during startup.
The fixup stage of `zebra_if_update_all_links()` goes into the last of
`interface_lookup_netlink()`, it can't be executed in the case of error in
above `netlink_parse_info()`s.

`RTM_GETTUNNEL` is not supported in linux kernel until 5.18, so
`netlink_parse_info()` will throw error with the previous versions.

If two conditions are met, (it is a common case)
1. Interfaces are created before frr restart/start
2. Linux kernel version < 5.18

the link dependencies will not be done, then evpn feature will be broken.
IMO we should just ignore this error.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-09-08 06:27:01 -04:00
Jafar Al-Gharaibeh
3f069ea90b
Merge pull request #11913 from mjstapp/fix_rcu_bgp_keepalive
bgpd: release rcu lock in bgp keepalive pthread
2022-09-08 00:22:28 -05:00
Donald Sharp
97a0bfc5ca
Merge pull request #11915 from opensourcerouting/topotests-collect
topotests: ignore env for pytest --collect-only
2022-09-07 12:59:26 -04:00
Donald Sharp
27e8358522
Merge pull request #11916 from leonshaw/fix/conf-vrf-netns
zebra: Reconfiguring netns for vrf is not a failure
2022-09-07 12:58:39 -04:00
Donald Sharp
bdf57638ee
Merge pull request #11914 from anlancs/fix/cleanup-lib-name
lib: replace one path with macro
2022-09-07 12:54:38 -04:00
Donatas Abraitis
f66624f5c0 bgpd: Fix aggregate-address summary-only matching-MED-only
Before it worked only when configured initially via CLI. Later, when we
receive a new route, that should match a decent MED, we just skip it, because
MED mismatch is not recalculated.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-07 14:39:19 +03:00
Xiao Liang
d61e157a47 zebra: Reconfiguring netns for vrf is not a failure
When using namespace VRF backend, and frr.conf contains:

    vrf test
      netns /run/netns/test
    exit-vrf

FRR fails to start:

    line 11: Failure to communicate[13] to zebra, line:  netns /run/netns/test

Fix this by returning CMD_WARNING rather than CMD_WARNING_CONFIG_FAILED
when the same netns path is configured.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2022-09-07 17:52:09 +08:00
anlan_cs
b5d1433e6d lib: replace one path with macro
Replace all of the path name with macro, only the two places.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-09-07 01:10:14 -04:00
Jafar Al-Gharaibeh
1762461ca8
Merge pull request #11911 from mruprich/ospf-api
ospfd: Adding SUPPORT_OSPF_API define in ospf_spf.c
2022-09-06 22:55:58 -05:00
Rafael Zalamena
340ed5f9e2
Merge pull request #11823 from pguibert6WIND/bgp_vpnv4_gre_ebgp
Bgp vpnv4 convey without transport label
2022-09-06 13:37:19 -03:00
David Lamparter
3d80bd11aa topotests: ignore env for pytest --collect-only
`--collect-only` does not run any tests, so bypass env checks for it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-09-06 17:43:26 +02:00
Donatas Abraitis
cbe4fd18fc
Merge pull request #11864 from manojvn/clis
ospfd: Added clis to change default timers for LSA refresh and maxage remove delay.
2022-09-06 18:32:56 +03:00