summaryrefslogtreecommitdiff
path: root/pimd/pim_neighbor.c
AgeCommit message (Collapse)Author
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-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: pim_rp.c -> convert pimg to pimDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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-05-30Merge pull request #576 from chiragshah6/pim_devDavid Lamparter
pimd: pim bfd support
2017-05-17pimd: pim bfd supportChirag Shah
All PIM Neighbors for a given pim interface is registered with BFD. Upon receiving BFD status down event, PIM Neighbor with BFD info is deleted. Add pim bfd configuraiton (CLI) per interface, '[no] ip pim bfd' Testing Done: Configure BFD under PIM interface on all neighbor routers, check bfd sessions up, remote end unconfigure BFD, results in BFD session down. Previous state was UP to New state DOWN, results in PIM neighbor delete behind that particular pim interface. Pim-smoke Results: Ran 94 tests in 7409.680s FAILED (SKIP=8, failures=2) Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
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-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-02Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp
2017-04-25pimd: fix pimd crashes around pim rpfChirag Shah
During neighbor down event, all upstream entries rpf lookup may result into nhop address with 0.0.0.0 and rpf interface info being NULL. Put preventin check where rpf interface info is accessed. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-04-25pimd: Pim Nexthop Tracking support with ECMPChirag Shah
In this patch, PIM nexthop tracking uses locally populated nexthop cached list to determine ECMP based nexthop (w/ ECMP knob enabled), otherwise picks the first nexthop as RPF. Introduced '[no] ip pim ecmp' command to enable/disable PIM ECMP knob. By default, PIM ECMP is disabled. Intorudced '[no] ip pim ecmp rebalance' command to provide existing mcache entry to switch new path based on hash chosen path. Introduced, show command to display pim registered addresses and respective nexthops. Introuduce, show command to find nexthop and out interface for (S,G) or (RP,G). Re-Register an address with nexthop when Interface UP event received, to ensure the PIM nexthop cache is updated (being PIM enabled). During PIM neighbor UP, traverse all RPs and Upstreams nexthop and determine, if any of nexthop's IPv4 address changes/resolves due to neigbor UP event. Testing Done: Run various LHR, RP and FHR related cases to resolve RPF using nexthop cache with ECMP knob disabled, performed interface/PIM neighbor flap events. Executed pim-smoke with knob disabled. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com> (cherry picked from commit cba444817883b8b3b22a7ed9958dc9ed77f76230)
2017-04-24Merge pull request #345 from chiragshah6/pim_devRenato Westphal
pimd: Pim ECMP changes along with nexthop tracking using cached DB
2017-04-06pimd: Pim Nexthop Tracking support with ECMPChirag Shah
In this patch, PIM nexthop tracking uses locally populated nexthop cached list to determine ECMP based nexthop (w/ ECMP knob enabled), otherwise picks the first nexthop as RPF. Introduced '[no] ip pim ecmp' command to enable/disable PIM ECMP knob. By default, PIM ECMP is disabled. Intorudced '[no] ip pim ecmp rebalance' command to provide existing mcache entry to switch new path based on hash chosen path. Introduced, show command to display pim registered addresses and respective nexthops. Introuduce, show command to find nexthop and out interface for (S,G) or (RP,G). Re-Register an address with nexthop when Interface UP event received, to ensure the PIM nexthop cache is updated (being PIM enabled). During PIM neighbor UP, traverse all RPs and Upstreams nexthop and determine, if any of nexthop's IPv4 address changes/resolves due to neigbor UP event. Testing Done: Run various LHR, RP and FHR related cases to resolve RPF using nexthop cache with ECMP knob disabled, performed interface/PIM neighbor flap events. Executed pim-smoke with knob disabled. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-03-30pimd: Add code to find neighbor by secondaryDonald Sharp
With RFC 5549 we need a methodology to find a neighbor based upon a nexthop that is v6 based. This commit sets us up for that by allowing you to find the neigbor by the secondary list. In a future commit we will add code to pass the v6 secondary addresses. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-02pimd: Join/Prune AggregationDonald Sharp
Add the ability for PIM to send Join/Prunes as an aggregated message instead of individual messages for each S,G. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-17Merge remote-tracking branch 'origin/master' into pim_lib_work2Donald Sharp
2016-12-21pimd: Reset neighbor hold time when we receive packetDonald Sharp
When we receive a packet from a neighbor, reset the hold time as that we *know* that they are still alive. During heavy packet load, we were seeing cases where neighbors were being reset because we were timing out due to not processing the hello packet in time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Actually expedite a helloDonald Sharp
When we get a new neighbor for an interface, we need to send a hello out that interface in some situations. At this time we were tracking this by the pim_ifstat_hello_sent value but not reseting it when we received a new neighbor. Ticket: CM-13769 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-nexthop: mroute and pim-upstream rpf are falling out of sync.anuradhak
Currently the mroute-IIF and upstream RPF-IIF/neigh are resolved separately. This must change i.e. be merged together for a couple of reasons - 1. In the case of ECMP we will use a load-share mechanism (based on G or SG) to pick an RPF neighbor in 3.2.1 (to use the load-sharing cap of anycast-RP). Using a different resolution mechanism for mroute-IIF will simply not work. 2. In a non-CLOS topology it is actually possible to have routers that do not participate in PIM. In this case the tree will be set up using different routers than the ones chosen for the mroute IIF. And traffic will not be forwarded. This change is however too big for 3.2.0. So to handle CM-13714 I have simply forced rpf update on neigh add which fixes the specific problem seen on link flap in a clos (it is not very efficient but traffic recovers). In problem state - (jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# ip mr (0.0.0.0, 225.1.1.1) Iif: lo Oifs: swp3 lo (20.0.11.253, 225.1.1.1) Iif: swp1 Oifs: swp3 (jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# vtysh -c "show ip pim upstream" Iif Source Group State Uptime JoinTimer RSTimer KATimer RefCnt lo * 225.1.1.1 Joined 00:08:44 00:00:15 --:--:-- --:--:-- 1 swp2 20.0.11.253 225.1.1.1 Joined 00:08:35 00:00:56 --:--:-- 00:02:59 1 (jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Remove unnecessary assertsDonald Sharp
When we handle the thread arguments, there is no need to assert. As that if they are wrong, we are going down shortly anyways. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21pimd: Resolve rp after neighbor come upDonald Sharp
When a neighbor comes up, see if we suddenly have a path to the RP. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Don't assert when looking up a neighborDonald Sharp
Do not assert when looking up a neighbor, we don't know if we have a neighbor don't punish us. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add the ability to lookup neighbor on a interfaceDonald Sharp
On a specified interface return the single neighbor on that interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: trigger on nbr up to look at rpf cacheDonald Sharp
If a neighbor comes up *after* igmp joins and *after* all the routes are installed into the kernel, then we never go back and fix up the rpf cache information. So joins never go out for those igmp joins. Ticket: CM-12613 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Send hello immediately with receive of new genidDonald Sharp
When we receive a new genid from a neighbor, we need to form the neigbhor relationship before the join/prune messages are sent to the neighbor. Additionally we were calling the pim_upstream_rpf_genid_changed function 2 times in a row. This function just spun throught the upstream list and marked all relevant upstreams to be sent immediately Ticket:CM-11979 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Remove unnecessary QuaggaIdDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Use XCALLOC instead of XMALLOCDonald Sharp
Ensure that all data structures start out as 0 filled. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix use of 0 for NULLDonald Sharp
pimd uses allot of 0's to represent NULL. Not a good programming practice. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-20build: remove $Format tagsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-06-23pimd: Move timer information to TRACE_DETAILDonald Sharp
Move another timer informational debug to TRACE_DETAIL Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-23pimd: Turn some trace information to trace detailDonald Sharp
Turn some PIM_TRACE to PIM_TRACE_DETAIL. Log file was getting spammed with unneeded information. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-17pimd: Separate pim vif index spot from ifindexDonald Sharp
Allow pim to separate out the pim vif index from the ifindex. This change will allow pim to work with up to 255(MAXVIFS) interfaces, while also allowing the interface ifindex to be whatever number it needs to be. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Cleanup zebra debugs to be protected by debug commandsDonald Sharp
pimd is very chatty without any pim debugs turned on. This commit fixes a bunch of the debugs to be protected by appropriate pim debug statement. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Fix first DR ElectionDonald Sharp
The function pim_neighbor_new caused the dr election before the addition of the neighbor to the pim_ifp->pim_neighbor_list, in pim_neighbor_add, which is needed to properly elect the correct DR. Move the dr_election and hello trigger till after the addition to the list. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Add ability to set DR Priority for an interfaceDonald Sharp
From RFC 4601, Section 4.3.1: The DR_Priority Option allows a network administrator to give preference to a particular router in the DR election process by giving it a numerically larger DR Priority. The DR_Priority Option SHOULD be included in every Hello message, even if no DR Priority is explicitly configured on that interface. This is necessary because priority-based DR election is only enabled when all neighbors on an interface advertise that they are capable of using the DR_Priority Option. The default priority is 1. This modification allows the setting of the DR Priority on a per interface basis. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: merge pimd as of 2015-01-19David Lamparter
Welcome pimd to the Quagga daemon zoo! This is a merge of commit 77ae369 ("pimd: Log ifindex found for an interface when zebra lib reports a new connected address."), with the intermediate "reconnect" changes removed (c9adf00...d274381). d274381 is replaced with b162ab7, which includes some changes. In addition, 4 reconnect-related changes and 1 cosmetic one have been bumped out. The rebase command used to produce the branch that is merged here is: git rebase --onto b162ab7 c9adf00 77ae369 Note that 3 patches had their author rewritten from "Anonymous SR#108542 <>" (which is not a valid git author ID) to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address listed in the associated Savannah ticket) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>