summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd.c
AgeCommit message (Collapse)Author
2020-03-06*: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp
FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-03Merge pull request #5897 from patrasar/2415676Russ White
pimd: fix crash seen while executing igmp related configuration
2020-03-03pimd: fix crash seen while executing igmp related configurationSarita Patra
Issue 1: 1. Enable pim on an interface. 2. Configure query-interval or query max response time, which results in pimd crash. Root cause: 1. When pim is enabled on an interface, it creates a igmp socket with querier_timer and other_querier time as NULL. 2. When query-interval/max_response_time is configured, it call the function igmp_sock_query_reschedule() to reshedule the query. This function check either of querier_timer or other_querier timer should be running. Since in this case both are NULL, it results in crash. Issue 2: 1. Enable pim on an interface. 2. Execute no ip igmp query-interval or query max response time, which results in pimd crash. Root cause: 1. When pim is enabled on an interface, it creates a pim interface with querier_timer and other_querier time as NULL. 2. When no ip igmp query-interval/max_response_time is executed, it will check either of querier_timer or other_querier timer should be running. Since in this case both are NULL, it results in crash. Fix: When pim is enabled on an interface, it creates a igmp socket with mtrace_only as true. So add a check if mtrace_only is true, then don't reshedule the query. Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-02-28*: change hash_backet to hash_bucketDonald Sharp
It's been a year search and destroy. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-27Revert "*: change hash_backet to hash_bucket"Jafar Al-Gharaibeh
This reverts commit 3895c42a2eb534a70ef25412547e798c1c1ef5a1. LabN CI update needs to be coordinated before merging this Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-02-26*: change hash_backet to hash_bucketDonald Sharp
It's been a year search and destroy. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-20pimd: fix SA reportsMark Stapp
Fix a couple of SA warnings introduced recently; replace some 'strcpy' calls. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-14pimd: pim mlag show commandsAnuradha Karuppiah
1. show ip pim mlag summary provides MLAG session information and stats 2. show ip pim mlag upstream displays the upstream entries synced across the MLAG switches Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: stop overloading SRC_IGMP upstream for vxlan local membershipAnuradha Karuppiah
A local membership is created on the vxlan termination device ipmr-lo. This is done to - 1. Pull multicast vxlan tunnel traffic to the VTEP for termination by triggering JoinDesired on the BUM multicast group. 2. Include the OIF in the mroute to signal to the dataplane component that flow needs to be vxlan terminated. Earlier we were overloading the PIM_UPSTREAM_FLAG_MASK_SRC_IGMP for this local membership creation but that is creating confusion both in the state machine and in the show outputs. To avoid that we use the more apparent PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM. With this change - 1. We get LHR functionality for VXLAN_TERM mroutes 2. OIF is populated with PIM_OIF_FLAG_PROTO_PIM only Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pim: DF election for tunnel termination mroutes in an anycast-VTEP setupAnuradha Karuppiah
1. Upstream entries associated with tunnel termination mroutes are synced to the MLAG peer via the local MLAG daemon. 2. These entries are installed in the peer switch (via an upstream ref flag). 3. DF (Designated Forwarder) election is run per-upstream entry by both the MLAG switches - a. The switch with the lowest RPF cost is the DF winner b. If both switches have the same RPF cost the MLAG role is used as a tie breaker with the MLAG primary becoming the DF winner. 4. The DF winner terminates the multicast traffic by adding the tunnel termination device to the OIL. The non-DF suppresses the termination device from the OIL. Note: Before the PIM-MLAG interface was available hidden config was used to test the EVPN-PIM functionality with MLAG. I have removed the code to persist that config to avoid confusion. The hidden commands are still available. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-06*: Replace s_addr 0 => INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-03pimd: Convert the upstream_list and hash to a rb treeDonald Sharp
Convert the upstream_list and hash to a rb tree, Significant time was being spent in the listnode_add_sort. This reduces this time greatly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-03pimd: Convert the channel_oil_list|hash to a rb_treeDonald Sharp
The channel_oil_list and hash are taking significant cpu at scale when adding to the sorted list. Replace with a RB_TREE. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-20pimd: refactor ip mroute cmdJafar Al-Gharaibeh
combine: ip mroute INTERFACE A.B.C.D ip mroute INTERFACE A.B.C.D A.B.C.D into: ip mroute INTERFACE A.B.C.D [A.B.C.D] Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2019-12-16Merge pull request #5427 from liam-mcb/igmp-join-anyDonald Sharp
pimd: Add command to join any-source multicast.
2019-12-12pimd: Add command to join any-source multicast.Liam McBirnie
Allow 'ip igmp join' to join group for any source if no source is specified. Disallow joining source "0.0.0.0" as it is used to define an any-source multicast group. Signed-off-by: Liam McBirnie <liam.mcbirnie@boeing.com>
2019-12-06Merge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixesJafar Al-Gharaibeh
PIM state machine fixes
2019-11-22Merge pull request #5328 from satheeshkarra/pim_mlagMark Stapp
pimd, lib, zebra : PIM MLAG Support
2019-11-20pimd: fixup whitespace errors reported by CIAnuradha Karuppiah
No functional changes. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-18pimd: Create pimreg interface when we start any interface configDonald Sharp
When you configure interface configuration without explicitly configuring pim on that interface, we were not creating the pimreg interface and as such we would crash in an attempted register since the pimreg device is non-existent. The crash is this: ==8823== Invalid read of size 8 ==8823== at 0x468614: pim_channel_add_oif (pim_oil.c:392) ==8823== by 0x46D0F1: pim_register_join (pim_register.c:61) ==8823== by 0x449AB3: pim_mroute_msg_nocache (pim_mroute.c:242) ==8823== by 0x449AB3: pim_mroute_msg (pim_mroute.c:661) ==8823== by 0x449AB3: mroute_read (pim_mroute.c:707) ==8823== by 0x4FC0676: thread_call (thread.c:1549) ==8823== by 0x4EF3A2F: frr_run (libfrr.c:1064) ==8823== by 0x40DCB5: main (pim_main.c:162) ==8823== Address 0xc8 is not stack'd, malloc'd or (recently) free'd pim_register_join calls pim_channel_add_oif with: pim_channel_add_oif(up->channel_oil, pim->regiface, PIM_OIF_FLAG_PROTO_PIM); We just need to make srue pim->regiface exists once we start configuring pim. Fixes: #5358 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-15pimd: bring back "show ip pim upstream-join-desired"Anuradha Karuppiah
It is now used to evaluate and display join-desired state for each upstream entry - root@spine-1:~# net show pim upstream-join-desired Source Group EvalJD * 239.1.1.111 yes 6.0.0.28 239.1.1.111 yes 6.0.0.29 239.1.1.111 no 6.0.0.30 239.1.1.111 yes Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: rename the upstream-join-desired command to "show ip pim channel"Anuradha Karuppiah
This re-naming was needed because the JD state on an upstream is not just based on channel info i.e. we can have JD=true even if there is no downstream channel. The "show ip upstream-join-desired" command will be changed to display that info i.e. upstream's JD state instead of downstream channel params. The downstream channel params are now available via "show ip pim channel" PS: This change maybe reverted if upstream NAKs it. But there is a pressing need for it to debug some not-so-reproduible problems. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: enforce PIM_ENFORCE_LOOPFREE_MFC at the time of MFC programmingAnuradha Karuppiah
This is needed for two reasons - 1. The inherited OIL needs to be setup independent of the RPF interface to allow correct computation of the JoinDesired macro. 2. The RPF interface is computed at the time of MFC programming so it is not possible to permanently evict the OIF at that time oif_add Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: display the per-RPF neighbor join-prune agg listAnuradha Karuppiah
root@leaf-12:~# vtysh -c "show ip pim jp-agg" Interface RPF Nbr Source Group State swp1 6.0.0.26 * 239.1.1.111 J swp1 6.0.0.26 * 239.1.1.112 J swp1 6.0.0.26 * 239.1.1.113 J swp1 6.0.0.26 * 239.1.1.114 J root@leaf-12:~# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: display changes to indicate if a SG entry is still on the RPTAnuradha Karuppiah
Sample output - root@leaf-12:~# net show pim state Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL 1 * 239.1.1.111 y swp1 swp3( J ) 1 6.0.0.28 239.1.1.111 y swp1 1 * 239.1.1.112 y swp1 swp3( J ) 1 6.0.0.28 239.1.1.112 y swp1 1 * 239.1.1.113 y swp1 swp3( J ) 1 6.0.0.28 239.1.1.113 y swp1 1 * 239.1.1.114 y swp1 swp3( J ) 1 6.0.0.28 239.1.1.114 y swp1 root@leaf-12:~# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: MUTE flag to suppress traffic forwarding on non-DFAnuradha Karuppiah
If an mroute loses DF election (with the MLAG peer) it has to stop forwarding traffic on active-active devices such as ipmr-lo used for vxlan traffic termination. To acheive that this commit introduces a concept of OIF muting. That way we can let the PIM and IGMP state machines play out and silence OIFs after the fact. Relevant outputs: ================= 1. muted OIFs are displayed with the M flag in "pim state" - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> root@TORC12:~# net show pim state |grep "27.0.0.13"|grep 100 1 27.0.0.13 239.1.1.100 uplink-1 ipmr-lo( *M) root@TORC12:~# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 2. And supressed altogether in the mroute output - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> root@TORC12:~# net show mroute |grep "27.0.0.13"|grep 100 27.0.0.13 239.1.1.100 none uplink-1 none 0 --:--:-- root@TORC12:~# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-13pimd : Add support for MLAG Register & Un-registerSatheesh Kumar K
when ever a FRR Client wants to send any data to another node using MLAG Channel, uses below mechanisam. 1. sends a MLAG Registration to zebra with interested messages that it is intended to receive from peer. 2. In response to this request, Zebra opens communication channel with MLAG. and also in Rx. diretion zebra forwards only those messages which client shown interest during registration 3. when client is no-longer interested in communicating with MLAG, client posts De-register to Zebra 4. if this is the last client which is interested for MLAG Communication, zebra closes the channel. why PIM Needs MLAG Communication ================================ 1. In general on LAN Networks elecetd DR will send the Join towards Multicast RP in case of a LHR and Register in case of FHR. 2. But in case DR Goes down, traffic will be re-converged only after the New DR is elected, but this can take time based on Hold Timer to detect the DR down. 3. this can be optimised by using MLAG Mecganisam. 4. and also Traffic can be forwarded more efficiently by knowing the cost towards RP using MLAG Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-10-29pimd: Duplicate config is not a CMD_WARNING_CONFIG_FAILEDDonald Sharp
When you enter: ip pim ssm prefix-list my-custom-ssm-range ip pim ssm prefix-list my-custom-ssm-range The second instance would cause a failure to happen which should not happen w/ duplicate config. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25pimd: result was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBODonald Sharp
The result variable was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBO earlier in the function. No need to do the same thing twice. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-14Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"Quentin Young
This reverts commit d563896dada99f3474d428f928786cbfde936fee, reversing changes made to 09ea1a40386f02a13cdb0462cc55af0d03f0c277.
2019-09-16pimd : Add support for MLAG Register & Un-registerSatheesh Kumar K
when ever a FRR Client wants to send any data to another node using MLAG Channel, uses below mechanisam. 1. sends a MLAG Registration to zebra with interested messages that it is intended to receive from peer. 2. In response to this request, Zebra opens communication channel with MLAG. and also in Rx. diretion zebra forwards only those messages which client shown interest during registration 3. when client is no-longer interested in communicating with MLAG, client posts De-register to Zebra 4. if this is the last client which is interested for MLAG Communication, zebra closes the channel. why PIM Needs MLAG Communication ================================ 1. In general on LAN Networks elecetd DR will send the Join towards Multicast RP in case of a LHR and Register in case of FHR. 2. But in case DR Goes down, traffic will be re-converged only after the New DR is elected, but this can take time based on Hold Timer to detect the DR down. 3. this can be optimised by using MLAG Mecganisam. 4. and also Traffic can be forwarded more efficiently by knowing the cost towards RP using MLAG Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-07-06pimd: fix some help stringsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-01*: s/TRUE/true/, s/FALSE/false/Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-25Merge pull request #4525 from donaldsharp/some_cleanupsRafael Zalamena
Some cleanups
2019-06-25Merge pull request #4520 from rgirada/fix_clear_mrouteDavid Lamparter
pimd: Added cli to generate igmp query.
2019-06-24pimd: Added cli to generate igmp query.rgirada
Fix details : Added a utility cli to generate a igmp query on an interface. This won't impact the existing query generation based on the general query interval. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2019-06-23Revert "Ospf missing interface handling 2"Donald Sharp
2019-06-22Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2Donald Sharp
Ospf missing interface handling 2
2019-06-19pimd: ALLOC functions cannot fail.Donald Sharp
There is no need to check for ALLOC function failures in the code base. If we cannot get more memory we assert. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-12lib/clippy: error out on unsupported bitsDavid Lamparter
clippy can't process #ifdef or similar bits inside of an argument list (e.g. within the braces of a DEFUN or DEFPY statement.) Improve error reporting to catch these cases instead of generating broken C code. Fixes: #3840 Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12*: change if_lookup_by_name() api with vrfPhilippe Guibert
the vrf_id parameter is replaced by struct vrf * parameter. this impacts most of the daemons that look for an interface based on the name and the vrf identifier. Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was ignored until now. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-11Merge pull request #4494 from donaldsharp/no_src_for_youRuss White
pimd: The PIM_OIF_FLAG_PROTO_SRC flag was never used
2019-06-08pimd: The PIM_OIF_FLAG_PROTO_SRC flag was never usedDonald Sharp
Nor should it be. So remove from system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-07lib, pimd, sharpd: Various output string cleanupsDonald Sharp
Various compilers in our CI system were complaining about various auto-conversions. Let's get these cleaned up a bit more. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-04Merge pull request #4452 from donaldsharp/mroute_countRuss White
pim: Add `clear ip mroute [vrf NAME] count` command
2019-06-03pimd: Add `clear ip mroute [vrf NAME] count` command to pimDonald Sharp
When debugging a large number of mroutes and data is changing fast it is sometimes hard to know what has actually changed. Add a `clear ip mroute count` command that resets the last data points gathered and allows you to see what has changed since the last clear. Output: donna.cumulusnetworks.com# show ip mroute count Source Group LastUsed Packets Bytes WrongIf * 224.0.1.60 272 0 0 0 10.50.11.11 239.255.255.250 2 1 203 1 10.50.11.13 239.255.255.250 66 1 203 1 10.50.11.100 239.255.255.250 68 1 203 1 10.50.11.114 239.255.255.250 62 2 406 1 10.50.11.129 239.255.255.250 10 1 199 1 10.50.11.143 239.255.255.250 44 1 203 1 10.50.11.144 239.255.255.250 44 1 203 1 10.50.11.156 239.255.255.250 66 1 203 1 10.50.11.235 239.255.255.250 149 0 0 0 10.50.11.246 239.255.255.250 54 5 965 1 donna.cumulusnetworks.com# clear ip mroute count donna.cumulusnetworks.com# show ip mroute count Source Group LastUsed Packets Bytes WrongIf * 224.0.1.60 279 0 0 0 10.50.11.11 239.255.255.250 9 0 0 0 10.50.11.13 239.255.255.250 73 0 0 0 10.50.11.100 239.255.255.250 76 0 0 0 10.50.11.114 239.255.255.250 69 0 0 0 10.50.11.129 239.255.255.250 17 0 0 0 10.50.11.143 239.255.255.250 51 0 0 0 10.50.11.144 239.255.255.250 51 0 0 0 10.50.11.156 239.255.255.250 73 0 0 0 10.50.11.235 239.255.255.250 156 0 0 0 10.50.11.246 239.255.255.250 61 0 0 0 donna.cumulusnetworks.com# show ip mroute count Source Group LastUsed Packets Bytes WrongIf * 224.0.1.60 300 0 0 0 10.50.11.11 239.255.255.250 30 0 0 0 10.50.11.13 239.255.255.250 94 0 0 0 10.50.11.100 239.255.255.250 96 0 0 0 10.50.11.114 239.255.255.250 90 0 0 0 10.50.11.119 239.255.255.250 7 1 203 1 10.50.11.127 239.255.255.250 3 2 406 1 10.50.11.129 239.255.255.250 38 0 0 0 10.50.11.143 239.255.255.250 72 0 0 0 10.50.11.144 239.255.255.250 72 0 0 0 10.50.11.156 239.255.255.250 94 0 0 0 10.50.11.197 239.255.255.250 2 1 200 1 10.50.11.235 239.255.255.250 177 0 0 0 10.50.11.246 239.255.255.250 82 0 0 0 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03pimd: Convert strncpy to strlcpy in pim_cmd.cDonald Sharp
A couple of places of strncpy snuck in due to my confusion about if Quentin's earlier change had gotten in. Just some code in flux. This should fix the issue/warnings in our CI system.
2019-06-03pimd: Remove unused functionsDonald Sharp
Recent commits rewrote the `clear mroute` command and this caused these two two functions to no longer be used, remove. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03Merge pull request #4274 from rgirada/fix_clear_mrouteDonald Sharp
pimd: Re-deisgn the "clear ip mroute" command.