summaryrefslogtreecommitdiff
path: root/pimd/pim_ifchannel.c
AgeCommit message (Collapse)Author
2017-12-12pimd: Really, Actually send S,G rpt prune upstreamDonald Sharp
When we receive a S,G rpt prune message for a mroute, really, absolutely, guarantee the send upstream immediately. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-10*: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal
This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10*: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal
This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05*: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp
Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-15*: use clang's 'ForEachMacros' format style optionRenato Westphal
This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-13pimd: More S,G RPT prune state missinformationDonald Sharp
If you read the extra fine print of the PIM RFC it asks you to stop the PP Timer and the Expiry Timer when you are certain S,G RPT states. This commit puts this into practice and it also deletes the S,G ifchannel if necessary. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
2017-08-24pimd: Cleanup S,GRPt prune handling on Mroute LossDonald Sharp
1) Clean up display of S,GRPt prune state to be more meaningful 2) Upon receipt of a S,GRPt prune make sure we transition to the correct state 3) Upon loss of a S,GRPt prune make sure we transition to the correct state as well as immediately send a *,G join upstream to propagate the loss of the prune. 4) Removal of a weird S,G state being installed upon loss of a S,G RPt prune. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-14pimd: Ensure cleanup of S,G on ifchannel failure to createDonald Sharp
There exists a path for ifchannel creation that if a S,G fails to create and a corresponding *,G ifchannel is there, the S,G will be deleted but we were leaving the S,G in the *,G ifchannel sources list. Remove from the list in this case Ticket: CM-17605 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Convert to using a RB tree for the pim_ifp ifchannel_listDonald Sharp
This patch does two things: 1) Converts the pim_ifp->ifchannel_list to a pim_ifp->ifchannel_rb 2) Removes the hashing to use the RB RB_FIND instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Rename pim_ifp->pim_ifchannel_listDonald Sharp
Remove the redundant information in pim_ifp->pim_ifchannel_list just call it pim_ifp->ifchannel_list Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Remove almost duplicate pim->ifchannel_listDonald Sharp
The pim->ifchannel_list can be duplicated by iterating over each vrf and then over each pim_ifp->pim_ifchannel_list Since list handling is taking allot of time at scale convert over to using this value. Additionally clean up pim_cmd.c to have helper functions to handle the actual encoding of data for output. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-28pimd: Allow the keepalive time to be per vrf.Donald Sharp
Allow the keepalive period to be per vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Allow installation of NULL mroute in some situationsDonald Sharp
When we receive a S,G,RPT prune as part of a *,G tree, install the NULL oil S,G mroute. This will cause the traffic to stop flowing for this particular S,G as we expect. Ticket: CM-16978 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix unininitialized data usage found by clangDonald Sharp
clang 5.0 to the rescue! Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Ensure that we properly shutdown threads on start failureDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix some small crashes in pimDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix crash with ifchannel and upstreamDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix code to not send joins when SGRPT Prune is receivedDonald Sharp
When we receive a SGRPT Prune we were switching the upstream to JOINED and immediately sending a join. This was not the right thing to do. This was happening because we were making decisions about the new ifchannel before it was fully formed. Rework ifchannel startup to provide enough information to the pim upstream data structure to make the right decisions Ticket: CM-16425 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix crash when attempting to use channel_oil->pim before it is assignedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Cleanup some basic crashes from mistakes made converting to vrfDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Cleanup pim_ssm.c to use 'struct pim_instance *'Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Move pim_ifchannel_list and vif array into 'struct pim_instance *'Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Remove pimg from pim_upstream.cDonald Sharp
Move the upstream_list, hash and wheel into 'struct pim_instance' Remove all pimg to pim in pim_upstream Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Create the pimreg per vrfDonald Sharp
2017-07-24pimd: Remove unnecessary NULL checkDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Cleanup use of VRF_DEFAULT to pimg->vrf_idDonald Sharp
Use the appropriate vrf_id instead of always defaulting to VRF_DEFAULT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-22Revert "*: reindent pt. 2"David Lamparter
This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17*: reindent pt. 2whitespace / reindent
w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-06Merge branch 'stable/3.0'David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-02pimd: Remove qpim_inaddr_anyDonald Sharp
In prep for switching over to having PIM understand VRF remove the qpim_inaddr_any global variable and just use INADDR_ANY directly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18pimd: Fix to Tx S,G Join when SGRpt->Join stateChirag Shah
-Upon Rx (*,G) Join w/o SGRpt at RP, trigger (S,G) Join towards FHR, unset SGRpt flag from channel, add (*,G) oif to (S,G) entry. -Add I am not RP check to triger SGRpt on *,G path otherwise, send S,G Prune on SPT path from RP to FHR upon receving *,G Prune. -Upon Rx SGRpt receive, remove OIF(downstream where Prune received) from specific S,G. Testing Done: pim-smoke Ran 95 tests in 11790.552s FAILED (SKIP=10, failures=4) Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-18Merge remote-tracking branch 'origin/master' into pim_crash_a_booDonald Sharp
2017-05-18pimd: Fix indentation issue that is causing clang unhappinessDonald Sharp
The indentation of ifjoin_to_noinfo was not consistent with the rest of the function and caused clang to loose it's mind Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18pimd: Fix indentation issue that is causing clang unhappinessDonald Sharp
The indentation of ifjoin_to_noinfo was not consistent with the rest of the function and caused clang to loose it's mind Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18Merge branch 'stable/3.0'David Lamparter
Conflicts: ospf6d/ospf6_lsa.c ospfd/ospf_vty.c zebra/interface.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-17pimd: Thread changes allow pim to crash a booDonald Sharp
When we add a thread pointer to thread_add_XXX functions when the specified function is called, thread.c is setting the thread pointer to NULL. This was causing pim to liberally pull it's zassert grenade pin's. Additionally clean up code to not set the NULL pointer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-16pimd: Fix input value to boolChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-16pimd: Avoid deleting SGRpt entry from PP->P stateChirag Shah
-Upon Receving SGRpt Prune message, transitioning from Prune Pending state to NOINFO state, ifchannel entry was getting deleted in prune pending timer expiry. This can result in SGRpt ifhchannel deleted and recreated upon receving triggered or periodic SGRpt received from downstream. The automation test failed as it expected (check) SGRpt entry at RP after it triggers SPT switchover. - While transitioning from Prune-Pending state to NOINFO(Pruned) state, Trigger SGRpt message towards RP. - Add/del some of the debug traces Ticket:CM-16057 Reviewed By:CCR-6198 Testing Done: Rerun test08 multiple times and observed passing it. Pim-smoke with hardnode Ran 95 tests in 11219.420s FAILED (SKIP=10, failures=4) Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-09*: remove THREAD_ON macros, add nullity checkQuentin Young
The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-06pimd: Fix WG/SGRpt & WG J/P processingChirag Shah
During processing of Join/Prune, for a S,G entry, current state is SGRpt, when only *,G is received, need to clear SGRpt and add/inherit the *,G OIF to S,G so it can forward traffic to downstream where *,G is received. Upon receiving SGRpt prune remove the inherited *,G OIF. From, downstream router received *,G Prune along with SGRpt prune. Avoid sending *,G and SGRpt Prune together. Reset upstream_del reset ifchannel to NULL. Testing Done: Run failed smoke test of sending data packets, trigger SPT switchover, *,G path received SGRpt later data traffic stopped S,G ages out from LHR, sends only *,G join to upstream, verified S,G entry inherit the OIF. Upon receiving SGRpt deletes inherited oif and retains in SGRpt state. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-04pimd: Note when a S,G stream should be a FHR as wellDonald Sharp
When we have a S,G being created, that it might also be a FHR router as well. This happens when the FHR is in the path of the RP->LHR for when it builds it's SPT tree for the S,G. Ticket: CM-16056, CM-15836 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-28Merge branch 'stable/3.0' into pim_dev_3_0Jafar Al-Gharaibeh
2017-04-25pimd: Fix WG/SGRpt & WG J/P processingChirag Shah
During processing of Join/Prune, for a S,G entry, current state is SGRpt, when only *,G is received, need to clear SGRpt and add/inherit the *,G OIF to S,G so it can forward traffic to downstream where *,G is received. Upon receiving SGRpt prune remove the inherited *,G OIF. Testing Done: Trigger SPT switchover, *,G path received SGRpt later data traffic stopped S,G ages out from LHR, sends only *,G join to upstream, verified S,G entry inherit the OIF. Upon receiving SGRpt deletes inherited oif and retains in SGRpt state. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-04-20pimd: Tweak pim_ifchannel_compare to be fasterDonald Sharp
Tweak the ifchannel compare to sort based upon interface first Ticket: CM-15629 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-20pimd: Add ability for upstream to know it's ifchannelsDonald Sharp
Add a list structure to track the ifchannels associated with a particular upstream. We are not doing anything with this particular knowledge yet but it will be come useful in the near future. Ticket: CM-15629 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-20pimd: Limit search to relevant ifchannels in some casesDonald Sharp
When we are determining an inherited_olist, let's be allot smarter about what we look at. Before this code change we are looping over the entirety of all ifchannels in the system to find the relevant ones. Convert the code to *find*(hash table lookup) the specific ifchannels we are interested in. Ticket: CM-15629 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-20pimd: When loosing *,G igmp report notify S,G tooDonald Sharp
When we have a S,G that was created due to the *,G IGMP report going away, safely remove the S,G as well. Ticket: CM-15838 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2017-04-20pimd: Add prefix list handling to spt-switchoverDonald Sharp
To the 'ip pim spt-switchover infinity-and-beyond' command add 'prefix-list <PLIST>'. To the command. Use this as the basis to deny (Not immediate switchover) or permit (Immediate switchover), based upon matching the group address and the prefix-list. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>