summaryrefslogtreecommitdiff
path: root/pimd
AgeCommit message (Collapse)Author
2024-12-03pimd: Fix access-list memory leak in pimdCorey Siltala
Reset access-lists in pimd on terminate Signed-off-by: Corey Siltala <csiltala@atcorp.com> (cherry picked from commit d21a993f16dc23df6a1f1a7c81e9f562446437a0)
2024-10-25pimd: allow resolving bsr via directly connected secondary addressJafar Al-Gharaibeh
This only matters to single hop nodes that are adjacent to the bsr. More common with IPv6 where LL address is used in PIM as the primary address. If the BSR IP happens to be an address on the same interface, the receiving pim router rejects the BSR address because it expects the BSR IP to resolve via the LL address even if we have a connected route for the same BSR IP subnet. Effectively, we want to allow rpf to be resolved via secondary IPs with connected routes on the same interface, and not limit them to primary addresses. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com> (cherry picked from commit d23a7d0949aaa9aa95d6d3ae293ac4eea81e19f5)
2024-07-25pimd: Fix msdp setting of sa->rpDonald Sharp
The code is clearly incorrect. After consultation with the original author this is the decided change. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit c4b4c242ec8cfcdb23f0f90faaa0ff76577e1364)
2024-07-22pimd: fix crash on non-existent interfaceLouis Scalbert
Fix the following crash when pim options are (un)configured on an non-existent interface. > r1(config)# int fgljdsf > r1(config-if)# no ip pim unicast-bsm > vtysh: error reading from pimd: Connection reset by peer (104)Warning: closing connection to pimd because of an I/O error! > #0 raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50 > #1 0x00007f70c8f32249 in core_handler (signo=11, siginfo=0x7fffff88e4f0, context=0x7fffff88e3c0) at lib/sigevent.c:258 > #2 <signal handler called> > #3 0x0000556cfdd9b16d in lib_interface_pim_address_family_unicast_bsm_modify (args=0x7fffff88f130) at pimd/pim_nb_config.c:1910 > #4 0x00007f70c8efdcb5 in nb_callback_modify (context=0x556d00032b60, nb_node=0x556cffeeb9b0, event=NB_EV_APPLY, dnode=0x556d00031670, resource=0x556d00032b48, errmsg=0x7fffff88f710 "", errmsg_len=8192) > at lib/northbound.c:1538 > #5 0x00007f70c8efe949 in nb_callback_configuration (context=0x556d00032b60, event=NB_EV_APPLY, change=0x556d00032b10, errmsg=0x7fffff88f710 "", errmsg_len=8192) at lib/northbound.c:1888 > #6 0x00007f70c8efee82 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x556d00032b60, errmsg=0x7fffff88f710 "", errmsg_len=8192) at lib/northbound.c:2016 > #7 0x00007f70c8efd658 in nb_candidate_commit_apply (transaction=0x556d00032b60, save_transaction=true, transaction_id=0x0, errmsg=0x7fffff88f710 "", errmsg_len=8192) at lib/northbound.c:1356 > #8 0x00007f70c8efd78e in nb_candidate_commit (context=..., candidate=0x556cffeb0e80, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7fffff88f710 "", errmsg_len=8192) at lib/northbound.c:1389 > #9 0x00007f70c8f03e58 in nb_cli_classic_commit (vty=0x556d00025a80) at lib/northbound_cli.c:51 > #10 0x00007f70c8f043f8 in nb_cli_apply_changes_internal (vty=0x556d00025a80, > xpath_base=0x7fffff893bb0 "/frr-interface:lib/interface[name='fgljdsf']/frr-pim:pim/address-family[address-family='frr-routing:ipv4']", clear_pending=false) at lib/northbound_cli.c:178 > #11 0x00007f70c8f0475d in nb_cli_apply_changes (vty=0x556d00025a80, xpath_base_fmt=0x556cfdde9fe0 "./frr-pim:pim/address-family[address-family='%s']") at lib/northbound_cli.c:234 > #12 0x0000556cfdd8298f in pim_process_no_unicast_bsm_cmd (vty=0x556d00025a80) at pimd/pim_cmd_common.c:3493 > #13 0x0000556cfddcf782 in no_ip_pim_ucast_bsm (self=0x556cfde40b20 <no_ip_pim_ucast_bsm_cmd>, vty=0x556d00025a80, argc=4, argv=0x556d00031500) at pimd/pim_cmd.c:4950 > #14 0x00007f70c8e942f0 in cmd_execute_command_real (vline=0x556d00032070, vty=0x556d00025a80, cmd=0x0, up_level=0) at lib/command.c:1002 > #15 0x00007f70c8e94451 in cmd_execute_command (vline=0x556d00032070, vty=0x556d00025a80, cmd=0x0, vtysh=0) at lib/command.c:1061 > #16 0x00007f70c8e9499f in cmd_execute (vty=0x556d00025a80, cmd=0x556d00030320 "no ip pim unicast-bsm", matched=0x0, vtysh=0) at lib/command.c:1227 > #17 0x00007f70c8f51e44 in vty_command (vty=0x556d00025a80, buf=0x556d00030320 "no ip pim unicast-bsm") at lib/vty.c:616 > #18 0x00007f70c8f53bdd in vty_execute (vty=0x556d00025a80) at lib/vty.c:1379 > #19 0x00007f70c8f55d59 in vtysh_read (thread=0x7fffff896600) at lib/vty.c:2374 > #20 0x00007f70c8f4b209 in event_call (thread=0x7fffff896600) at lib/event.c:2011 > #21 0x00007f70c8ed109e in frr_run (master=0x556cffdb4ea0) at lib/libfrr.c:1217 > #22 0x0000556cfdddec12 in main (argc=2, argv=0x7fffff896828, envp=0x7fffff896840) at pimd/pim_main.c:165 > (gdb) f 3 > #3 0x0000556cfdd9b16d in lib_interface_pim_address_family_unicast_bsm_modify (args=0x7fffff88f130) at pimd/pim_nb_config.c:1910 > 1910 pim_ifp->ucast_bsm_accept = > (gdb) list > 1905 case NB_EV_ABORT: > 1906 break; > 1907 case NB_EV_APPLY: > 1908 ifp = nb_running_get_entry(args->dnode, NULL, true); > 1909 pim_ifp = ifp->info; > 1910 pim_ifp->ucast_bsm_accept = > 1911 yang_dnode_get_bool(args->dnode, NULL); > 1912 > 1913 break; > 1914 } > (gdb) p pim_ifp > $1 = (struct pim_interface *) 0x0 Fixes: 3bb513c399 ("lib: adapt to version 2 of libyang") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit 6952bea5cdd38057bf8c0a5e9c0fbe916dc73953)
2024-05-31pimd: fix crash when mixing ssm/any-source joinsJafar Al-Gharaibeh
There is no reason to call `igmp_anysource_forward_stop()` inside a call to `igmp_get_source_by_addr()`; not only it is not expected for a "get" function to perform such an action, but also the decision to start/stop forwarding is already handled correctly by pim outside `igmp_get_source_by_addr()`. That call was left there from the days pim was initially imported into the sources. The problem/crash was happening because `igmp_find_source_by_addr()` would fail to find the group/source combo when mixing `(*, G)` and `(S, G)`. When having an existing flow `(*, G)`, and a new `(S, G)` igmp is received, a new entry is correctly created. `igmp_anysource_forward_stop(group)` always stops and eventually frees `(*, G)`, even when the new igmp is `(S, G)`, leaving a bad state. I.e, the new entry for `(S, G)` causes `(*, G)` to be deleted. Tested the fix with multiple receivers on the same interface with several ssm and any source senders and receivers with various combination of start/stop orders and they all worked correctly. Fixes: #15630 Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com> (cherry picked from commit a951960a15e8b6b5ed248abb0ecc9eb4e9a3427f)
2024-05-09pimd: fix order of operations for evaluating joinDavid Lamparter
join_desired looks at whether up->channel_oil is empty. up->channel_oil is updated from pim_forward_stop(), calling pim_channel_del_oif(). But that was being called *after* updating join_desired, so join_desired saw a non-empty OIL. Pull up the pim_forward_stop() call to before updating join_desired. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit fdb1a6fed5a8e42447b5b9633ad9df0f3042d0a9)
2024-05-09pimd: fix null register before aging out reg-stopDavid Lamparter
It looks like the code was trying to do this with the null_register parameter on pim_upstream_start_register_stop_timer(), but that didn't quite work right. Restructure a bit to get it right. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit dce38da8061a7ac62c690dbb8a89cae7f9a758d6)
2024-05-09pimd: fix dr-priority rangeDavid Lamparter
0 is a valid DR priority. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit b564c1d890aef75067db22df09e608faf72b99f5)
2024-04-27pimd: fix crash unconfiguring rp keepalive timerVijayalaxmi Basavaraj
pimd crashs while unconfigure of rp ka timer as we are trying to access a yand dnode(suppress timer) which does not exist at the moment. User just configured rp keepalive timer and not suppress timer, the yang dnode would not be present. Instead of directly accessing yang_dnode_get_unit16, first check the yang node exist using the xpath. Ticket: #3874971 Testing: Before: ------ tor-11(config)# no ip pim rp keep-alive-timer 3000 vtysh: error reading from pimd: Success (0)Warning: closing connection to pimd because of an I/O error! Broadcast message from root@tor-11 (somewhere) (Mon Apr 22 17:29:12 2024): cumulus-core: Running cl-support for core files "pimd.25467.1713806952.core" After: ----- tor-11(config)# no ip pim rp keep-alive-timer 3000 tor-11(config)# Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Vijayalaxmi Basavaraj <vbasavaraj@nvidia.com> (cherry picked from commit 0c4b7c1f1f359c1d7647fea34f62378af8b640a5)
2024-02-09pimd: re-evaluated S,G OILs upon RP changes and for empty SG upstream oilsRajesh Varatharaj
Topology: TOR11 (FHR) --- LEAF-11---SPINE1 (RP)MSDP SPINE-2(RP)MSDP --- LEAF-12 -- TOR12 (LHR) | | | | | | -----------------------------------------------------(ECMP) | | | | | -----------------------------------------------------------------------(ECMP) Issue: In some triggers, S,G upstream is preserved even with the PP timer expiry, resulting in S,G with NULL OILS. This could be because we create a dummy S,G upstream and dummy channel_oif for *,G, where RPF is UNKNOWN. As a result, PIM+VXLAN traffic is never forwarded downstream to LHR. Fix: when the S,G stream is running, Determine if a reevaluation of the outgoing interface list (OIL) is required. S,G upstream should then inherit the OIL from *,G. Testing: - Evpn pim tests - TestEvpnPimSingleVtepOneMdt.test_02_broadcast_traffic_spt_zero - pim-smoke Ticket: # Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com> (cherry picked from commit 071d43a052e04de52771b2f03461c407f0ced36f)
2024-01-23pimd: fix crash when configuring ssmpingdIgor Ryzhov
Command: `ip ssmpingd 1.1.1.1` Backtrace: ``` __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 0x00007fd1d3b02859 in __GI_abort () at abort.c:79 0x00007fd1d3e323e1 in yang_dnode_xpath_get_canon (dnode=<optimized out>, xpath_fmt=<optimized out>, ap=<optimized out>) at lib/yang_wrappers.c:61 0x00007fd1d3e34f41 in yang_dnode_get_ipv4 (addr=addr@entry=0x7ffc368554d4, dnode=<optimized out>, xpath_fmt=xpath_fmt@entry=0x5556af8680d4 "./source-addr") at lib/yang_wrappers.c:826 0x00005556af8216d3 in routing_control_plane_protocols_control_plane_protocol_pim_address_family_ssm_pingd_source_ip_create (args=0x7ffc36855530) at pimd/pim_nb_config.c:925 0x00007fd1d3dec13f in nb_callback_create (nb_node=0x5556b197ea40, nb_node=0x5556b197ea40, errmsg_len=8192, errmsg=0x7ffc36855a90 "", resource=0x5556b18fa6f8, dnode=0x5556b1ad7a10, event=NB_EV_APPLY, context=0x5556b1ad75c0) at lib/northbound.c:1260 nb_callback_configuration (context=0x5556b1ad75c0, event=NB_EV_APPLY, change=<optimized out>, errmsg=0x7ffc36855a90 "", errmsg_len=8192) at lib/northbound.c:1648 0x00007fd1d3deca6c in nb_transaction_process (event=event@entry=NB_EV_APPLY, transaction=transaction@entry=0x5556b1ad75c0, errmsg=errmsg@entry=0x7ffc36855a90 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1779 0x00007fd1d3decdd6 in nb_candidate_commit_apply (transaction=0x5556b1ad75c0, save_transaction=save_transaction@entry=true, transaction_id=transaction_id@entry=0x0, errmsg=errmsg@entry=0x7ffc36855a90 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1129 0x00007fd1d3decf15 in nb_candidate_commit (context=..., candidate=<optimized out>, save_transaction=save_transaction@entry=true, comment=comment@entry=0x0, transaction_id=transaction_id@entry=0x0, errmsg=0x7ffc36855a90 "", errmsg_len=8192) at lib/northbound.c:1162 0x00007fd1d3ded4af in nb_cli_classic_commit (vty=vty@entry=0x5556b1ada2a0) at lib/northbound_cli.c:50 0x00007fd1d3df025f in nb_cli_apply_changes_internal (vty=vty@entry=0x5556b1ada2a0, xpath_base=xpath_base@entry=0x7ffc36859b50 ".", clear_pending=clear_pending@entry=false) at lib/northbound_cli.c:177 0x00007fd1d3df06ad in nb_cli_apply_changes (vty=vty@entry=0x5556b1ada2a0, xpath_base_fmt=xpath_base_fmt@entry=0x0) at lib/northbound_cli.c:233 0x00005556af80fdd5 in pim_process_ssmpingd_cmd (vty=0x5556b1ada2a0, operation=NB_OP_CREATE, src_str=0x5556b1ad9630 "1.1.1.1") at pimd/pim_cmd_common.c:3423 0x00007fd1d3da7b0e in cmd_execute_command_real (vline=vline@entry=0x5556b1ac9520, vty=vty@entry=0x5556b1ada2a0, cmd=cmd@entry=0x0, up_level=up_level@entry=0) at lib/command.c:982 0x00007fd1d3da7cb1 in cmd_execute_command (vline=vline@entry=0x5556b1ac9520, vty=vty@entry=0x5556b1ada2a0, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:1040 0x00007fd1d3da7e50 in cmd_execute (vty=vty@entry=0x5556b1ada2a0, cmd=cmd@entry=0x5556b1ae0a30 "ip ssmpingd 1.1.1.1", matched=matched@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1207 0x00007fd1d3e278be in vty_command (vty=vty@entry=0x5556b1ada2a0, buf=<optimized out>) at lib/vty.c:591 0x00007fd1d3e27afd in vty_execute (vty=0x5556b1ada2a0) at lib/vty.c:1354 0x00007fd1d3e2bb23 in vtysh_read (thread=<optimized out>) at lib/vty.c:2362 0x00007fd1d3e22254 in event_call (thread=thread@entry=0x7ffc3685cd80) at lib/event.c:2003 0x00007fd1d3dce9e8 in frr_run (master=0x5556b183c830) at lib/libfrr.c:1218 0x00005556af803653 in main (argc=6, argv=<optimized out>, envp=<optimized out>) at pimd/pim_main.c:162 ``` Signed-off-by: Igor Ryzhov <iryzhov@nfware.com> (cherry picked from commit 8ffc3640f00a7bd97911f997365c693172fafb69)
2023-11-02pimd: Ensure upstream points at the correct rpfDonald Sharp
In the scenario on an intermediate router where a *,G join has been received and a S,G stream is being sent through that router on the *,G stream, there exists a situation when the *,G in has been pruned but the stream is still being received on on incoming interface towards the RP for the *,G. In this situation PIM will see the S,G stream initially as a NOCACHE from the dataplane, PIM will then do a RPF for the S and notice that it is supposed to be coming in on adifferent interface. In this case PIM the original PIM code would create a blackhole mroute towards the RPF of the *,G( the interface the stream is being received on ). The original reason for this is that if there is a scenario where this particular S1,G stream is sending at basically line rate, and there also happens to be a different S2,G stream that is sending at a very low rate. With certain dataplanes there is no way to really rate limit the S1 -vs- S2 stream and the S1 stream completely overwhelms the S2 stream for sending up to the control plane for proper pim handling. The problem then becomes that FRR never properly responds to the situation where the *,G is rereceived and the S,G stream switches back over to the SPT for itself and FRR ends up with a dead mroute that stops everything from working properly. This code change, installs the blackhole mroute with the RPF towards the RP for the G and then resets the RPF to the correct RPF for the Stream but does not modify the mroute. When the *,G is rereceived and we attempt to transition to the S,G stream this now works. As a note: Both David L and myself do not necessarily believe we fully understand the problem yet. What this does do is fix all the inconsistent CI issues we are seeing in the topotests at this time. Internally I am seeing other test failures in PIM that I don't fully understand and we suspect that there are other problems in the state machine. We plan to revisit this problem as we are able to debug the issue better. In the meantime both David and Myself agree that this gets the CI working again and Streams end up in the right state. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 33025d97b24c404f5000ed029f070c154d8d60a5)
2023-10-17pim6d: valgrind issue fixesMobashshera Rasool
Problem Statement: =================== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s) at 0x4975157: sendmsg (sendmsg.c:28) ==2263111== by 0x1413BE: pim_msg_send_frame (pim_pim.c:629) ==2263111== by 0x1413BE: pim_msg_send (pim_pim.c:743) ==2263111== by 0x1425DC: pim_register_send (pim_register.c:332) ==2263111== by 0x1427EE: pim_null_register_send (pim_register.c:443) ==2263111== by 0x14D228: pim_upstream_register_stop_timer (pim_upstream.c:1608) ==2263111== by 0x48CE6DF: thread_call (thread.c:1693) ==2263111== by 0x4899EFF: frr_run (libfrr.c:1068) ==2263111== by 0x11D035: main (pim6_main.c:190) ==2263111== Address 0x1ffeffdcb1 is on thread 1's stack ==2263111== in frame #2, created by pim_register_send (pim_register.c:273) ==2263111== Uninitialised value was created by a stack allocation ==2263111== at 0x142690: pim_null_register_send (pim_register.c:389) RCA: ==================== 1. All members of struct pim_msg_header were not initiliased while sending null register packet. Therefore when the pointers are assigned while sending the msg via sendmsg, it complains the pointer points to uninitialised byte. 2. struct ipv6_ph ph was also not initialised. Fix: ==================== Initialised all the members using memset. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com> (cherry picked from commit 1064818645339d09ecfd79c95d4ff2ac330b1147)
2023-10-10Merge pull request #13617 from anlancs/fix/pimd-remove-pimreg-vrfbase_9.1mergify/bp/dev/9.1/pr-13617mobash-rasool
pimd: Fix missing pimreg interface
2023-10-08Merge pull request #10733 from anlancs/zebra-remove-updateRafael Zalamena
zebra: remove ZEBRA_INTERFACE_VRF_UPDATE
2023-10-07*: remove ZEBRA_INTERFACE_VRF_UPDATEanlan_cs
Currently when one interface changes its VRF, zebra will send these messages to all daemons in *order*: 1) `ZEBRA_INTERFACE_DELETE` ( notify them delete from old VRF ) 2) `ZEBRA_INTERFACE_VRF_UPDATE` ( notify them move from old to new VRF ) 3) `ZEBRA_INTERFACE_ADD` ( notify them added into new VRF ) When daemons deal with `VRF_UPDATE`, they use `zebra_interface_vrf_update_read()->if_lookup_by_name()` to check the interface exist or not in old VRF. This check will always return *NULL* because `DELETE` ( deleted from old VRF ) is already done, so can't find this interface in old VRF. Send `VRF_UPDATE` is redundant and unuseful. `DELETE` and `ADD` are enough, they will deal with RB tree, so don't send this `VRF_UPDATE` message when vrf changes. Since all daemons have good mechanism to deal with changing vrf, and don't use this `VRF_UPDATE` mechanism. So, it is safe to completely remove all the code with `VRF_UPDATE`. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-10-04pimd: Indicating the rp in the msdp sa messageAdriano Marto Reis
Indicating the configured PIM Rendezvous Point (RP) in the MSDP SA message The RFC-3618, section 12.2.1, describes the fields included in the MSDP SA message. The "RP address" field is "the address of the RP in the domain the source has become active in". In the most common case, we will establish an MSDP connection from RP to RP. However, there are cases where we want to establish a MSDP connection from an interface/address that is not the RP. Section 3 of RFC-3618 describes that scenario as "intermediate MSDP peer". Moreover, the RP could be another router in the PIM domain - not the one establishing the MSDP connection. The current implementation could be problematic even with a single router per PIM domain. Consider the following scenario: * There are two PIM domains, each one with a single router. * The two routers are connected via two independent networks. Let's say that is to provide redundancy. * The routers are configured to establish two MSDP connections, one on each network (redundancy again). * A multicast source becomes active on the router 1. It will be communicated to router 2 via two independent MSDP SA messages, one per MSDP connection. * Without these changes, each MSDP SA message will indicate a different RP. * Both RP addresses will pass the RPF check, and both MSDP sources will be accepted. * If the router has clients interested in that multicast group, it will send PIM Join messages to both RPs and start receiving the multicast traffic from both. With the changes included in this commit, the multicast source available in router 1 would still be communicated to router 2 twice. But both MSDP SA messages would indicate the same RP, and one of them would be discarded due to failure in the RPF-check failure. Also, the changes allow us to define the RP that will be included in the MSDP SA message, and it could be one of the interfaces used to establish the MSDP connection, some other interface on the router, a loopback interface, or another router in the PIM domain. These changes should not create compatibility issues. As I mentioned, we usually establish MSDP connections from RP to RP. In this case, the result will be the same. We would still indicate the address used to establish the MSDP connection if the RP is not set - I wonder if that should even be a valid configuration. Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2023-09-23pimd: remove redundant closing socketanlan_cs
The socket has been closed in `ssmpingd_setsockopt()` in the wrong cases, so remove the redundant closing socket from outer layer. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-09-19pimd: Use a better name for oil_parentDonald Sharp
Use oil_incoming_vif instead of oil_parent. I had to go look this up as that I failed to remember that the linux kernel calls this parent for some bizarre reason. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-09-19Merge pull request #14299 from SaiGomathiN/14286Russ White
pimd,pim6d: Resolving the YANG datatype Inconsistency for PIM Hello Interval
2023-09-14pimd: Display oil_parent as a string name of the interfaceDonald Sharp
When debugging and outputting the oil_parent() let's just convert it to a string that is useful for people trying to debug pim Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-31pimd: Prevent crash when receiving register message when the RP() is unknownDonald Sharp
When receiving a register message for a Group, that the group has no associated RP specified. Prevent a crash from happening. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-30pimd,pim6d: Resolving the YANG datatype Inconsistency for PIM Hello IntervalSai Gomathi N
The YANG specification currently designates a uint8 data type for the hello interval, despite the CLI documentation (ip pim hello (1-65535) [(1-65535)]) indicating a maximum value of 65535. To address this inconsistency, updating the data type to uint16 allowing for a maximum value for hello intervals. Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2023-08-30pimd: When receiving a packet be more careful with length in pim_pim_packetDonald Sharp
a) If the length passed is the header length then it is possible that assignment of data will happen without data actually existing. b) Just move the assignment to after we ensure that the pim packet received is the minimum possible length that can be received. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-15Merge pull request #14193 from donaldsharp/pim_vxlan_weirdnessmobash-rasool
Do not look into pim's eyes, pim gets mad
2023-08-15Merge pull request #14016 from mjstapp/event_exec_ptrDonald Sharp
* : include event ptr in event_execute api
2023-08-14pimd: Add whether or not the rpf succeeded or not to the debugDonald Sharp
Hard to know what is going on if the debug doesn't tell us. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-14pimd: Intentionally rescan oil when RPF fails on upstream creationDonald Sharp
When pim is creating an upstream for a S,G that it has received *but* it has not received a route to the S, the oil is not scanned to see if it should inherit anything from the *,G that may be present when it cannot find the correct iif to use. When the nexthop tracking actually resolves the route, the oil is never rescanned and the S,G stream will be missing a correct oil list leading to absolute mayhem in the network. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-12pimd: Allow more immediate null registers to be sent in the vxlan codeDonald Sharp
When a pim vxlan S,G is created, the code attempts to send out a NULL register. This is used to build the S,G tree from the RP to the FHR. Upon initial startup it is not unusual for the pim vxlan state be fully ready to go but the RP is still not reachable. Let's add a bit of a pump prime that allows the vxlan code to re-attempt to send the null register for vxlan S,G's that the RP's outgoing interface changed from unknown to an actual interface. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-12pimd: Prevent vxlan from causing a S,G RPT Prune in some casesDonald Sharp
Upon startup the pim vxlan code initiates a pim null register send for the S,G and sends a *,G join towards the RP at the same time. Since a S,G upstream is created in the vxlan code with the appropriate flags, the *,G join has the embedded S,G RPT Prune. When an intermediate route receives this *,G RPT Prune it creates a blackhole S,G route since this particular intermediate router has not received a join from the RP yet( say the packet is lost, or that part of the network is slower coming up ). Let's try to intelligently decide that the S,G RPT Prune should not be sent as part of the *,G join until the actual S,G join from the RP reaches this box. Then we can make intelligent decisions about whether or not to send it out. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-31pimd, pim6d: Don't set SRC_STREAM flag on LHRSarita Patra
Setup: ------ R1( LHR) ---------R2( RP) ----------R3( FHR) Problem: ------- - Send IGMP/MLD join and traffic. LHR: (S,G) mroute is created with reference count = 2 and set the flag SRC_STREAM. (Code flow: pim_mroute_msg_wholepkt -> pim_upstream_add, pim_upstream_sg_running_proc -> pim_upstream_ref) - Send IGMP/MLD prune. LHR: removes (*,G) entry and it tries to remove childen (S,G) entries. But (S,G) is having reference count = 2. So after prune, (S,G) entry reference count becomes 1 and will be present until KAT expires. Fix: --- Don't set SRC_STREAM flag for LHR. In LHR, (S,G) should be maintained, until (*,G) is present. When prune receives delete (*,G) and children (S,G). When traffic stops, delete (S,G) after KAT expires. Issue: #13893 Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-07-25* : include event ptr in event_execute apiMark Stapp
Include an event ptr-to-ptr in the event_execute() api call, like the various schedule api calls. This allows the execute() api to cancel an existing scheduled task if that task is being executed inline. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-07-21pimd: Remove pim_addr_dumpDonald Sharp
This function is no longer used, remove it from the system. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21pimd: Convert usage of pim_addr_dump to %pFXhDonald Sharp
pim_addr_dump would dump the group data as a v4 or v6 address let's just convert to our internal printf handler. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-20Merge pull request #14006 from AbhishekNR/mld_coreDonald Sharp
pim6d: Fixing core while running MLD conformance test.
2023-07-20Merge pull request #13605 from anlancs/fix/pimd-promote-interfaceDonald Sharp
pimd: Fix missing promotion for primary address
2023-07-19Merge pull request #13629 from anlancs/fix/pimd-order-pimregDonald Sharp
pimd: Fix wrong creating order for pimreg
2023-07-18pim6d: Fixing core while running MLD conformance test.Abhishek N R
While running MLD conformance test 9.2 core is getting generated. Test setps: 1. ANVL: Listen (for upto <GeneralQueryRecvWaitTime> seconds) on <AIface-0>. 2. DUT: Send MLD General Query Message. 3. ANVL: Send MLD Report Message to <DIface-0> containing: • IPv6 Source Address field set to link-local IPv6 Address of HOST-1 • IPv6 Destination Address field set to <McastAddrGroup> • MLD Multicast Address field set to <McastAddrGroup>. 4. ANVL: Wait for <ProcessTime> seconds for DUT to process and add <Mcas- tAddrGroup> to its Multicast Address list. 5. ANVL: Send MLD General Query Message to <DIface-0> containing: • IPv6 Source Address field set to link-local IPv6 Address of RTR-1 which is numerically less than the link-local IPv6 unicast address of <DIface-0> • IPv6 Destination Address field set to link-scope all-nodes multicast address. 6. ANVL: Send MLD Multicast-Address-Specific Query Message to <DIface-0> containing: • IPv6 Source Address field set to link-local IPv6 Address of RTR-1 • IPv6 Destination Address field set to <McastAddrGroup> • MLD Multicast Address field set to <McastAddrGroup> • MLD Maximum Response Delay field value set to 0. 7. ANVL: Verify that the Maximum Response Delay timer for <McastAd- drGroup> is set to zero. While running above test, when group specific query is received we start gm_t_sg_expire timer. Once this timer expires, we clear the corresponding entry. During this sg->state was still set to JOIN. This happened because receiver went down without sending leave. Added a condition to update the sg->state before starting the timer. If receiver goes down without sending leave we will update sg->state to GM_SG_JOIN_EXPIRING or GM_SG_NOPRUNE_EXPIRING based on previous state. If we receive a join then sg->state will be refreshed and will be updated to JOIN state. Fixes: #13387 Signed-off-by: Abhishek N R <abnr@vmware.com>
2023-07-13Merge pull request #13717 from anlancs/fix/pimd-igmp-prot-back-2mobash-rasool
pimd: Fix wrong protocol for SSM
2023-07-10pimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cliSarita Patra
The cli "show ip pim nexthop json" gives the RPF information. However it doesn't give PIM enable status on the nexthop interface. Added pimEnabled field in this clis, this will tell if PIM is enabled or not on the nexthop interface. Example: frr# show ip pim nexthop Number of registered addresses: 1 Address Interface Nexthop 108.0.0.2 ens224 108.0.0.2 frr# show ip pim nexthop json { "108.0.0.2":{ "address":"108.0.0.2", "nexthops":[ { "interface":"ens224", "pimEnabled":true, "nexthop":"108.0.0.2" } ] } } frr# configure terminal frr(config)# int ens224 frr(config-if)# no ip pim frr(config-if)# end frr# show ip pim nexthop json { "108.0.0.2":{ "address":"108.0.0.2", "nexthops":[ { "interface":"ens224", "pimEnabled":false, "nexthop":"108.0.0.2" } ] } } Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-07-06Merge pull request #13837 from mobash-rasool/fixes2Donatas Abraitis
pim6d: MLD conformance querier-non-querier transition fix
2023-07-04Merge pull request #13467 from patrasar/pimv6_state_fixDonatas Abraitis
pim6d: "show ipv6 pim state" not displaying when OIL is empty
2023-06-27pimd: Fix memory leak in PIM interface deletionKeelan10
This commit ensures proper cleanup by deleting the gm_join_list when a PIM interface is deleted. The gm_join_list was previously not being freed, causing a memory leak. The ASan leak log for reference: ``` *********************************************************************************** Address Sanitizer Error detected in multicast_mld_join_topo1.test_multicast_mld_local_join/r1.asan.pim6d.28070 ================================================================= ==28070==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) #1 0x56230373dd6b in qcalloc lib/memory.c:105 #2 0x56230372180f in list_new lib/linklist.c:49 #3 0x56230361b589 in pim_if_gm_join_add pimd/pim_iface.c:1313 #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 #5 0x562303767280 in nb_callback_create lib/northbound.c:1235 #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 #13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053 #14 0x5623036c6392 in cmd_execute lib/command.c:1221 #15 0x5623037e75da in vty_command lib/vty.c:591 #16 0x5623037e7a74 in vty_execute lib/vty.c:1354 #17 0x5623037f0253 in vtysh_read lib/vty.c:2362 #18 0x5623037db4e8 in event_call lib/event.c:1995 #19 0x562303720f97 in frr_run lib/libfrr.c:1213 #20 0x56230368615d in main pimd/pim6_main.c:184 #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 192 byte(s) in 4 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) #1 0x56230373dd6b in qcalloc lib/memory.c:105 #2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288 #3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326 #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 #5 0x562303767280 in nb_callback_create lib/northbound.c:1235 #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 #13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053 #14 0x5623036c6392 in cmd_execute lib/command.c:1221 #15 0x5623037e75da in vty_command lib/vty.c:591 #16 0x5623037e7a74 in vty_execute lib/vty.c:1354 #17 0x5623037f0253 in vtysh_read lib/vty.c:2362 #18 0x5623037db4e8 in event_call lib/event.c:1995 #19 0x562303720f97 in frr_run lib/libfrr.c:1213 #20 0x56230368615d in main pimd/pim6_main.c:184 #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 96 byte(s) in 4 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) #1 0x56230373dd6b in qcalloc lib/memory.c:105 #2 0x562303721651 in listnode_new lib/linklist.c:71 #3 0x56230372182b in listnode_add lib/linklist.c:92 #4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295 #5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326 #6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 #7 0x562303767280 in nb_callback_create lib/northbound.c:1235 #8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 #9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 #10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 #11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 #12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 #13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 #14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 #15 0x5623036c5f1b in cmd_execute_command lib/command.c:1053 #16 0x5623036c6392 in cmd_execute lib/command.c:1221 #17 0x5623037e75da in vty_command lib/vty.c:591 #18 0x5623037e7a74 in vty_execute lib/vty.c:1354 #19 0x5623037f0253 in vtysh_read lib/vty.c:2362 #20 0x5623037db4e8 in event_call lib/event.c:1995 #21 0x562303720f97 in frr_run lib/libfrr.c:1213 #22 0x56230368615d in main pimd/pim6_main.c:184 #23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) #1 0x56230373dd6b in qcalloc lib/memory.c:105 #2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288 #3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326 #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 #5 0x562303767280 in nb_callback_create lib/northbound.c:1235 #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 #13 0x5623036c5f6f in cmd_execute_command lib/command.c:1072 #14 0x5623036c6392 in cmd_execute lib/command.c:1221 #15 0x5623037e75da in vty_command lib/vty.c:591 #16 0x5623037e7a74 in vty_execute lib/vty.c:1354 #17 0x5623037f0253 in vtysh_read lib/vty.c:2362 #18 0x5623037db4e8 in event_call lib/event.c:1995 #19 0x562303720f97 in frr_run lib/libfrr.c:1213 #20 0x56230368615d in main pimd/pim6_main.c:184 #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) #1 0x56230373dd6b in qcalloc lib/memory.c:105 #2 0x562303721651 in listnode_new lib/linklist.c:71 #3 0x56230372182b in listnode_add lib/linklist.c:92 #4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295 #5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326 #6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 #7 0x562303767280 in nb_callback_create lib/northbound.c:1235 #8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 #9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 #10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 #11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 #12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 #13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 #14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 #15 0x5623036c5f6f in cmd_execute_command lib/command.c:1072 #16 0x5623036c6392 in cmd_execute lib/command.c:1221 #17 0x5623037e75da in vty_command lib/vty.c:591 #18 0x5623037e7a74 in vty_execute lib/vty.c:1354 #19 0x5623037f0253 in vtysh_read lib/vty.c:2362 #20 0x5623037db4e8 in event_call lib/event.c:1995 #21 0x562303720f97 in frr_run lib/libfrr.c:1213 #22 0x56230368615d in main pimd/pim6_main.c:184 #23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: 400 byte(s) leaked in 11 allocation(s). *********************************************************************************** ``` Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-06-26pim6d: MLD conformance querier-non-querier transition fixMobashshera Rasool
Problem: ANVL Conformance test case 7.31 failed because DUT after receiving MLD Done msg and a query message with lower adddress, DUT did not keep on sending the group specific queries since it moved to non-querier state. As per RFC 2710 s4 p7, DUT is supposed to keep sending the group specific queries until either it receives the membership report or there is no response even after last member query is sent. Fix: Whenever group specific queries are sent out we are checking if the self node is querier, if not it does not sends this query out. This check is preventing the continuation of the last queries which must be sent out although the self node is not the querier. Hence removing the check from the api gm_trigger_specific_query and adding in the caller to make sure this event is only added for queriers. This will make sure the last member queries are sent out even during the transition phase. Also earlier this event was getting added for non-querier as well which is redundant since queries were not required to be sent out by non-queriers. Issue: #13539 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2023-06-21pim, pim6d: pimreg interface is not getting added in a certain scenarioSai Gomathi N
Problem: When ipv6 pim configuration is removed from the IIF on FHR node, if we wait for RST timer to expire and then add the ipv6 pim configuration on the IIF again, it is seen that pimreg is not getting added due to which null register wont be sent, the register flag state also remains NO_INFO forever instead of RegPrune. The reason for this is, when RST timer expires and IIF is unknown for the (S,G) upstream, the FHR state is not reset due to which when the RP becomes reachable, upstream state changes from NotJoined to Join but the register suppress timer could not be started since we see there is no change in FHR state. Fix: When the Register Timer expires and the reg state is set to PIM_REG_NOINFO,reset the FHR flag, so that when the RP becomes reachable can be because of config change or RP not reachable, it is able to resume its duty. Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2023-06-18Merge pull request #13765 from AbhishekNR/query-max-response-timeDonatas Abraitis
pim6d: Correcting the help string
2023-06-12pimd,pim6d: Correct the socket to send reg-stop msgMobashshera Rasool
We were using the pim interface socket to send the register stop msg, it works fine in cases where the interface on which register msg is received and the interface on which the register-stop msg is supposed to be sent is the same. But when the interfaces are different, msg send fails because the outgoing interface is not right. Fixes: #13774 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2023-06-11pim6d: Correcting the help stringAbhishek N R
Max response time in the code is being used as decisecond but the user input is taken in millisecond. Also yang expects the field to be in decisecond. The below condition in yang is failing due to the mismatch in units. ``` units deciseconds; must ". <= ../query-interval * 10"; ``` Issue: #11892 Signed-off-by: Abhishek N R <abnr@vmware.com>
2023-06-09Merge pull request #13727 from anlancs/pimd/cleanup-1mobash-rasool
pimd: adjust the display for debug
2023-06-08Merge pull request #13664 from routingrocks/pim_nb_fixDonatas Abraitis
pimd: Change in PIM northbound error, when a path to RP is not found …