Commit Graph

30881 Commits

Author SHA1 Message Date
Donald Sharp
a46e6f88f4 staticd: Tell bfd that we are shutting down
Prevent a use after free and tell the bfd subsystem
we are shutting down in staticd.

./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460:==2264460==ERROR: AddressSanitizer: heap-use-after-free on address 0x61f000004698 at pc 0x7f65d1eb11b2 bp 0x7ffdbface490 sp 0x7ffdbface488
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-READ of size 4 at 0x61f000004698 thread T0
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #0 0x7f65d1eb11b1 in zclient_bfd_command lib/bfd.c:307
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #1 0x7f65d1eb20f5 in _bfd_sess_send lib/bfd.c:507
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #2 0x7f65d20510aa in thread_call lib/thread.c:1989
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #3 0x7f65d2051f0a in _thread_execute lib/thread.c:2081
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #4 0x7f65d1eb271b in _bfd_sess_remove lib/bfd.c:544
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #5 0x7f65d1eb278d in bfd_sess_free lib/bfd.c:553
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #6 0x7f65d1eb5400 in bfd_protocol_integration_finish lib/bfd.c:1029
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #7 0x7f65d1f42f77 in hook_call_frr_fini lib/libfrr.c:41
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #8 0x7f65d1f494a1 in frr_fini lib/libfrr.c:1199
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #9 0x563b7abefd76 in sigint staticd/static_main.c:70
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #10 0x7f65d200ef91 in frr_sigevent_process lib/sigevent.c:115
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #11 0x7f65d204fac6 in thread_fetch lib/thread.c:1758
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #12 0x7f65d1f49377 in frr_run lib/libfrr.c:1184
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #13 0x563b7abefed1 in main staticd/static_main.c:160
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #14 0x7f65d1b92d09 in __libc_start_main ../csu/libc-start.c:308
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-    #15 0x563b7abefa99 in _start (/usr/lib/frr/staticd+0x15a99)
./bfd_topo3.test_bfd_topo3/r4.staticd.asan.2264460-

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7a185ac85e)
2023-03-21 19:37:52 +00:00
Donatas Abraitis
b8ef8251db
Merge pull request #13072 from FRRouting/mergify/bp/stable/8.5/pr-13062
zebra: Fix for heap-use-after-free in EVPN (backport #13062)
2023-03-21 15:31:18 +02:00
Pooja Jagadeesh Doijode
e24c799138 zebra: Fix for heap-use-after-free in EVPN
Issue:
When a netns is deleted, since zebra doesn’t receive interface down/delete
notifications from kernel, it manually deletes the interface without removing
the association between zebra_l3vni and the interface that is being deleted
(i.e it deletes the interface without setting “zl3vni->vxlan_if” to NULL).

Later, during the deletion of netns, when zl3vni_rmac_uninstall() is called to
uninstall the remote RMAC from the kernel, zebra ends up accessing stale
“zl3vni->vxlan_if” pointer, which now points to freed memory.
This was causing heap use-after-free.

Fix:
Before zebra starts deleting the interfaces when it receives netns delete notification,
appropriate functions() are being called to remove the association between evpn structs
and interface and set “zl3vni->vxlan_if” to NULL. This ensures that when
zl3vni_rmac_uninstall() is called during netns deletion, it will bail because
“zl3vni->vxlan_if” is NULL.

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
(cherry picked from commit 7eefea98ba)
2023-03-21 11:05:09 +00:00
Donald Sharp
8d2666fb03
Merge pull request #13067 from FRRouting/mergify/bp/stable/8.5/pr-13064
lib: fix clear route-map command (backport #13064)
2023-03-21 06:59:44 -04:00
Donald Sharp
86be025eab
Merge pull request #13069 from FRRouting/mergify/bp/stable/8.5/pr-13061
lib: on bfd peer shutdown actually stop event (backport #13061)
2023-03-21 06:58:42 -04:00
Donatas Abraitis
27b051fb88 lib: Include clippy generated commands for routemap.c
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-21 10:50:07 +02:00
Donald Sharp
b2450bba68 lib: on bfd peer shutdown actually stop event
When deleting a bfd peer during shutdown, let's ensure
that any scheduled events are actually stopped.

==7759== Invalid read of size 4
==7759==    at 0x48BF700: _bfd_sess_valid (bfd.c:419)
==7759==    by 0x48BF700: _bfd_sess_send (bfd.c:470)
==7759==    by 0x492F79C: thread_call (thread.c:2008)
==7759==    by 0x48E9BD7: frr_run (libfrr.c:1223)
==7759==    by 0x1C739B: main (bgp_main.c:550)
==7759==  Address 0xfb687a4 is 4 bytes inside a block of size 272 free'd
==7759==    at 0x48369AB: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==7759==    by 0x48BFA5A: bfd_sess_free (bfd.c:535)
==7759==    by 0x2B7034: bgp_peer_remove_bfd (bgp_bfd.c:339)
==7759==    by 0x29FF8A: peer_free (bgpd.c:1160)
==7759==    by 0x29FF8A: peer_unlock_with_caller (bgpd.c:1192)
==7759==    by 0x2A0506: peer_delete (bgpd.c:2633)
==7759==    by 0x208190: bgp_stop (bgp_fsm.c:1639)
==7759==    by 0x20C082: bgp_event_update (bgp_fsm.c:2751)
==7759==    by 0x492F79C: thread_call (thread.c:2008)
==7759==    by 0x48E9BD7: frr_run (libfrr.c:1223)
==7759==    by 0x1C739B: main (bgp_main.c:550)
==7759==  Block was alloc'd at
==7759==    at 0x4837B65: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==7759==    by 0x48F53AF: qcalloc (memory.c:116)
==7759==    by 0x48BF98D: bfd_sess_new (bfd.c:397)
==7759==    by 0x2B76DC: bgp_peer_configure_bfd (bgp_bfd.c:298)
==7759==    by 0x2B76DC: bgp_peer_configure_bfd (bgp_bfd.c:279)
==7759==    by 0x29BA06: peer_group2peer_config_copy (bgpd.c:2803)
==7759==    by 0x2A3D96: peer_create_bind_dynamic_neighbor (bgpd.c:4107)
==7759==    by 0x2A4195: peer_lookup_dynamic_neighbor (bgpd.c:4239)
==7759==    by 0x21AB72: bgp_accept (bgp_network.c:422)
==7759==    by 0x492F79C: thread_call (thread.c:2008)
==7759==    by 0x48E9BD7: frr_run (libfrr.c:1223)
==7759==    by 0x1C739B: main (bgp_main.c:550)

tl;dr -> Effectively, in this test setup we have 300 dynamic bgp
sessions all of which are using bfd.  When a peer collision is detected
or we remove the peers, if an event has been scheduled but not actually
executed yet the event event was not actually being stopped, leaving
the bsp pointer on the thread->arg and causing a crash when it is
executed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit f83431c7e8)
2023-03-21 07:00:30 +00:00
Sindhu Parvathi Gopinathan
51c7566f0a lib:fix clear route-map cmd using DEFPY
Due to the wrong input argv id, "argv[idx_word]->arg"
fetched in-correctly and it clears all the route-maps instead of
specific one.

Now correct argv id is passed to clear the given route-map counters.

Also, use RMAP_NAME which allows to show list of configured
route-maps in the system.

After Fix:-

Ticket:#3407773
Issue:3407773

Testing: UT done

Before:
TORC11# clear route-map counters
  <cr>
  WORD  route-map name

After:

TORC11# clear route-map counters
  <cr>
  RMAP_NAME  route-map name
     my-as

Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
(cherry picked from commit 463110f733)
2023-03-21 06:59:33 +00:00
Donald Sharp
64de7b5820
Merge pull request #13058 from opensourcerouting/fix/bgp_null_deref_8.5
bgpd: Prevent Null pointer deref when outputting data
2023-03-20 19:51:15 -04:00
Donald Sharp
e76d772ad4 bgpd: Prevent Null pointer deref when outputting data
Crash:

(gdb) bt
0  0x00007fee27de15cb in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007fee280ecd9c in core_handler (signo=11, siginfo=0x7ffe56001bb0, context=<optimized out>) at lib/sigevent.c:264
2  <signal handler called>
3  0x0000555e321c41b2 in prefix_rd2str (prd=0x10, buf=buf@entry=0x7ffe56002080 "27.0.0.R\340\373\062\062^U", size=size@entry=28) at bgpd/bgp_rd.c:168
4  0x0000555e321c431a in printfrr_prd (buf=0x7ffe560021a0, ea=<optimized out>, ptr=<optimized out>) at bgpd/bgp_rd.c:224
5  0x00007fee2812069b in vbprintfrr (cb_in=cb_in@entry=0x7ffe56002330, fmt0=fmt0@entry=0x555e3229a3ad " RD: %pRD\n", ap=ap@entry=0x7ffe560023d8) at lib/printf/vfprintf.c:564
6  0x00007fee28122ef7 in vasnprintfrr (mt=mt@entry=0x7fee281cb5e0 <MTYPE_VTY_OUT_BUF>, out=out@entry=0x7ffe560023f0 " RD: : R\n", outsz=outsz@entry=1024, fmt=fmt@entry=0x555e3229a3ad " RD: %pRD\n", ap=ap@entry=0x7ffe560023d8) at lib/printf/glue.c:103
7  0x00007fee28103504 in vty_out (vty=vty@entry=0x555e33f82d10, format=format@entry=0x555e3229a3ad " RD: %pRD\n") at lib/vty.c:190
8  0x0000555e32185156 in bgp_evpn_es_show_entry_detail (vty=0x555e33f82d10, es=0x555e33c38420, json=<optimized out>) at bgpd/bgp_evpn_mh.c:2655
9  0x0000555e32188fe5 in bgp_evpn_es_show (vty=vty@entry=0x555e33f82d10, uj=false, detail=true) at bgpd/bgp_evpn_mh.c:2721
notice prd=0x10 in #3.  This is because in bgp_evpn_mh.c we are sending &es->es_base_frag->prd.

There is one spot in the code where during output the es->es_base_frag is checked for non nullness
Let's just make sure it's right in all the places.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-20 16:13:05 +02:00
Donatas Abraitis
3fa49b125b
Merge pull request #13052 from FRRouting/mergify/bp/stable/8.5/pr-13049
lib: IPv6 prefix-list entry handling with `any` (backport #13049)
2023-03-20 07:58:43 +02:00
Donatas Abraitis
8e23fef97d lib: Destroy any flag when creating a prefix-list entry with prefix
The same as 61c07b9d43, but forgot to put IPv6
in place.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 14c1e0a169)
2023-03-19 22:39:22 +00:00
Donatas Abraitis
aa1ca32dbc tests: Check if prefix-lists with IPv6 any works fine
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit d8986f0134)
2023-03-19 22:39:22 +00:00
Donald Sharp
6da712b9e9
Merge pull request #13041 from FRRouting/mergify/bp/stable/8.5/pr-13038 2023-03-19 18:39:02 -04:00
Donatas Abraitis
d96b1906b5
Merge pull request #13043 from FRRouting/mergify/bp/stable/8.5/pr-13026
pbrd:fix mismatching in match src-dst (backport #13026)
2023-03-19 22:58:04 +02:00
Donatas Abraitis
d100d24386
Merge pull request #13045 from FRRouting/mergify/bp/stable/8.5/pr-13025
Ospf ti lfa leaks (backport #13025)
2023-03-19 22:57:53 +02:00
Donald Sharp
610c449198 ospfd: Free up q_space in early return path
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 52ff0e3ed4)
2023-03-19 04:45:23 +00:00
Donald Sharp
05dee7a121 ospfd: Fix ospf_ti_lfa drop of an entire table
The new_rtrs variable was just generated and then dropped.  Let's
fix that entirely

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit eb7e14011f)
2023-03-19 04:45:23 +00:00
Chirag Shah
907a881e64 pbrd:fix mismatching in match src-dst
upstream commit 67765a232d has incorect
address family check which prevent from
deleting src/dst config under pbr rule.

Ticket:#3405024
Issue:3405024
Testing Done:

Config:

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

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

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

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 03494887ed)
2023-03-19 04:43:02 +00:00
Donald Sharp
89992e547c ospfd: Cleanup some memory leaks on shutdown in ospf_apiserver.c
Clean up some memory leaks found in ospf_apiserver.c  Also
a crash in the original implementation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7773d0071a)
2023-03-19 04:29:22 +00:00
Donald Sharp
e4aa127939
Merge pull request #13035 from FRRouting/mergify/bp/stable/8.5/pr-13024
lib: Adjust only any flag for prefix-list entries if destroying (backport #13024)
2023-03-18 13:14:57 -04:00
Donatas Abraitis
6d7a03d0b1 lib: Adjust only any flag for prefix-list entries if destroying
Before this patch, if we destroy `any` flag for a prefix-list entry, we always
set destination as 0.0.0.0/0 and/or ::/0.

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

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 61c07b9d43)
2023-03-18 11:31:55 +00:00
Donatas Abraitis
444a4716fb tests: Check if route-map works correctly if modifying prefix-lists
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a1e538178c)
2023-03-18 11:31:54 +00:00
Donatas Abraitis
bba9437b6e
Merge pull request #13015 from FRRouting/mergify/bp/stable/8.5/pr-13009
bgpd: Use interface name instead of pointer value (backport #13009)
2023-03-18 00:04:59 +02:00
Donatas Abraitis
a121fa4900
Merge pull request #13021 from FRRouting/mergify/bp/stable/8.5/pr-13016
ospfd, ospfd6: Add more logging (backport #13016)
2023-03-18 00:04:22 +02:00
Martin Winter
07751d58e1 ospfd: Log Adjacency Changes with Neighbor IP in addition to Neighbor ID
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 386d232a1a)
2023-03-17 11:55:54 +00:00
Donatas Abraitis
922429d123 ospfd, ospf6d: Add more logging details
Basically just router-id or interface/IP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ba427e6348)
2023-03-17 11:55:53 +00:00
Donald Sharp
53737303c8 bgpd: Use interface name instead of pointer value
Log message is borked in a manner that makes it unusable:
bgpd[52]: [VX6SM-8YE5W][EC 33554460] 2000:31:0:53::2: nexthop_set failed, resetting connection - intf 0x561eb9005a30

Let's print out the interface name instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 50e049db76)
2023-03-17 07:56:45 +00:00
Donatas Abraitis
9b62b5d8c2
Merge pull request #13001 from FRRouting/mergify/bp/stable/8.5/pr-12996
tools: frr-reload fix list value not present (backport #12996)
2023-03-15 19:20:41 +02:00
Donatas Abraitis
34e3719e80
Merge pull request #12987 from FRRouting/mergify/bp/stable/8.5/pr-12978
pimd: IN_MULTICAST needs host order (backport #12978)
2023-03-15 14:09:34 +02:00
Chirag Shah
082061db90 tools: frr-reload fix list value not present
Check for value present in list before removing
as in certain python3 ValueError traceback is observed.

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

Ticket:#3389979
Issue:3389979

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 1543f58b55)
2023-03-15 12:00:32 +00:00
Donald Sharp
39a0e558ed pimd: IN_MULTICAST needs host order
New correct behavior:

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

Fixes: #12970
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 8083e71356)
2023-03-14 05:49:02 +00:00
Jafar Al-Gharaibeh
86a5e5a04d FRR Release 8.5
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-03-13 09:01:47 -05:00
Jafar Al-Gharaibeh
38a01043af debian, redhat: updating changelog for new release
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-03-13 09:01:30 -05:00
Donatas Abraitis
c353c87453
Merge pull request #12980 from FRRouting/mergify/bp/stable/8.5/pr-12974
bgpd: Increment version number even when no data is sent (backport #12974)
2023-03-13 07:11:48 +02:00
Donald Sharp
b5e938eee9 bgpd: Increment version number even when no data is sent
When an update group decides to not send a prefix
announcement because it has not changed, still increment
the version number.  Why?  To allow for the situation
where you have say 2 peers in 1 peer group and shortly
after they come up a 3rd peer comes up.  It will be
placed into a separate update group and could be
coalesced down, when it finishes updating all data
to it.  Now imagine that a single prefix changes at
this point in time as well.  Then first 2 peers may
decide to not send the data, since nothing has changed.
While the 3rd peer will and since the versions numbers
never match they will never coalesce.  So when the decision
is made to skip, update the version number as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit a8038460bd)
2023-03-12 19:49:38 +00:00
Donatas Abraitis
27f213516d
Merge pull request #12973 from FRRouting/mergify/bp/stable/8.5/pr-12962
bgpd: Check if the peer is configured as interface when checking NHT (backport #12962)
2023-03-11 09:38:20 +02:00
Donatas Abraitis
3efc883ad7 tests: Check if IPv6 BGP Link-Local peering works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0f4a09ac25)
2023-03-11 05:09:54 +00:00
Donatas Abraitis
3704fee75d bgpd: Check if the peer is configured as interface when checking NHT
This causes early return. peer->conf is NULL for IPv6 link-local peering,
and the session never establish.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e9ad26e53f)
2023-03-11 05:09:53 +00:00
Donatas Abraitis
9f31d57664
Merge pull request #12956 from FRRouting/mergify/bp/dev/8.5/pr-12951
bgpd: Fix use beyond end of stream of labeled unicast parsing (backport #12951)
2023-03-06 08:53:57 +02:00
Donald Sharp
ab362eae68 bgpd: Fix use beyond end of stream of labeled unicast parsing
Fixes a couple crashes associated with attempting to read
beyond the end of the stream.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7404a914b0)
2023-03-05 18:52:31 +00:00
Donatas Abraitis
ab09ebf717
Merge pull request #12952 from FRRouting/mergify/bp/dev/8.5/pr-12950
babeld: fix #11808 to avoid infinite loops (backport #12950)
2023-03-05 20:49:09 +02:00
harryreps
0a95d121ca babeld: fix #11808 to avoid infinite loops
Replacing continue in loops to goto done so that index of packet buffer
increases.

Signed-off-by: harryreps <harryreps@gmail.com>
(cherry picked from commit ae1e0e1fed)
2023-03-04 11:09:53 +00:00
Donatas Abraitis
c811c252d7
Merge pull request #12927 from FRRouting/mergify/bp/dev/8.5/pr-12903
pimd, pim6d: Don't track nexthop for RP 0.0.0.0 & 0::0 (backport #12903)
2023-03-02 12:41:30 +02:00
Donatas Abraitis
0a9a5c38b8
Merge pull request #12926 from FRRouting/mergify/bp/dev/8.5/pr-12921
pimd: Prevent crash when pimreg already exists. (backport #12921)
2023-03-02 11:21:04 +02:00
Donatas Abraitis
d6c7332418
Merge pull request #12925 from FRRouting/mergify/bp/dev/8.5/pr-12008
pimd, pim6d: Fix RPF check (backport #12008)
2023-03-02 10:36:37 +02:00
Sarita Patra
4801fe9ec4 pimd, pim6d: Don't track nexthop for RP 0.0.0.0 & 0::0
Topology:
========
FHR----Source

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

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

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

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

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

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

Issue: #12104

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 201a31b977)
2023-03-02 07:55:41 +00:00
Donald Sharp
c7df55983c pimd: Prevent crash when pimreg already exists.
If the pimreg device exists but it has not been set to the pim->pimreg pointer we can have
a crash.  Just prevent the crash since it's some sort of startup / re-org the network
issue.

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7ae7a3bfd6)
2023-03-02 06:15:21 +00:00
Sarita Patra
0770149af7 pimd, pim6d: Fix join prune handling
When upstream RPF address is secondary address, and
neighborship is built with primary address,
then pim_neighbor_find() fails.

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

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit d77da853f0)
2023-03-02 06:11:18 +00:00
Sarita Patra
cb8d50ecd9 pimd, pim6d: Fix pim upstream rpf change
When upstream RPF address is secondary, and
neighborship is built with primary address,
then pim_neighbor_find() fails, due to which when there
is upstream change it wont send prune.

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

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 689b9f10fc)
2023-03-02 06:11:18 +00:00