summaryrefslogtreecommitdiff
path: root/pimd/pim_zlookup.c
AgeCommit message (Collapse)Author
2019-03-28pimd: Cleanup extra paranthesis around S,G printoutDonald Sharp
When we are displaying S,G string data we already auto display the string as (S,G) no need to have ((S,G)). Cleanup some that were found during log look through. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04pimd: Create a `struct pim_router` and move thread master into itDonald Sharp
Create a `struct pim_router` and move the thread master into it. Future commits will further move global varaibles into the pim_router structure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-12*: Replace zclient_new with zclient_new_notifyDonald Sharp
It's been a year since we added the new optional parameters to instantiation. Let's switch over to the new name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-01pimd, zebra: Encode nexthop vrf in messageDonald Sharp
Encode the nexthop vrf in the message sent about mrib lookups. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-23pimd: Why was pim including zebra headers?Donald Sharp
Remove the inclusion of zebra headers from pim. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename ferr_zlog -> flog_err_sysQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14pimd: Add pim_errors and define some pim specific errorsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14pimd: Convert over to use LIB_ERR_XXX for zlog_errDonald Sharp
Convert, where appropriate, the zlog_err functions to zlog_ferr for the LIB_ERR_XXX enums Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-08pimd: Fix connected route nexthop fix from 66f5152fMartin Buck
Fix a couple of problems in my 1st fix for PIM nexthops reachable via a connected route: Use NEXTHOP_TYPE_IPV4_IFINDEX instead of NEXTHOP_TYPE_IPV4 since we add an IPv4 address to an already known ifindex. Assign nexthop_tab[num_ifindex].protocol_distance and .route_metric before incrementing num_ifindex. Revert the default: to individual switch case statement conversion in zclient_read_nexthop() as requested by donaldsharp in #2347 Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2018-06-05pimd: Fix nexthop determination when sending towards RPMartin Buck
When sending a PIM join upwards on the RP-based tree, it may get dropped on the last hop before the RP if the RP is reachable via a connected route (i.e. there's no associated nexthop). pimd needs to put the nexthop IP address into the PIM join payload and fails to do that if that route has a nexthop of 0.0.0.0. So whenever we look up a route to determine the nexthop or we receive a nexthop tracking update from Zebra, use the destination address as the nexthop address for connected routes. Fixes #2326. Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2018-03-30Merge pull request #1921 from donaldsharp/pim_stuffLou Berger
Pim stuff
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-17pimd: Move some data tracking variables per VRFDonald Sharp
There were a few more global variables that needed to be per vrf. So move them over. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-11-27*: Make zapi route install Notifications optionalDonald Sharp
Allow the higher level protocol to specify if it would like to receive notifications about it's routes that it has installed. I've purposely made it part of zclient_new_notify because we need to track the routes on a per daemon basis only. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23*: Modify zclient_init to require privs dataDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Cleanup nht debugsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Cleanup unused assignmentDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix pim not recognizing itself as an RP in some casesDonald Sharp
During normal course of operations, zebra sends the ZEBRA_INTERFACE_VRF_UPDATE call up into all connected zclients. In the case of PIM the zlookup was expecting a min length of 10, but ZEBRA_INTERFACE_VRF_UPDATE was sending of size 6. This min length check makes no sense, so just remove. Ticket: CM-16976 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-24pimd: Fixup NHT debugging to be a bit more coherentDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Remove unnecessary debug.Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Prevent Lockup when waiting for response from zebraDonald Sharp
When we have vrf config that we have not fully setup yet, (ie zebra knows nothing about it yet), when attempting to do a nexthop_lookup, zebra will just drop the request if it doesn't know about the vrf. In this case, we need to safely not ask for the information Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: debug guard error messageDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Make zlookup 'struct pim_instance' awareDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Convert vif and ifindex lookups to use 'struct pim_instance *'Donald 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-07-13*: ditch vty_outln(), part 1 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-30pimd: Fix zclient cleanup on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-29*: use vty_outlnQuentin Young
Saves 400 lines Signed-off-by: Quentin Young <qlyoung@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*: update thread_add_* callsQuentin Young
Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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-04-06pimd: Fix various sizeof and buffer length issuesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30pimd: Use better 5549 resolutionDonald Sharp
When we receive a v6 nexthop in v4, lookup the nbr by it's secondary address. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15*: Remove non-vrf based ifindex lookupDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-14pimd: mroute entries unresolved IIF issueChirag Shah
Ticket:CM-14056 Reviewed By:sharpd, CCR-5603 Testing Done: verified multiple ifdown/ifup event on submitter setup and dev setup with 2k s,g entries, ran pim-smoke. 1. during ifdown event, pim vif for bridge was not resetting vif_index to -1 due to errno received from kernel during vif del sequence. It could be timing issue where kernel may have delete prior to pimd sending request. For vif_del even kernel returns error, reset vif_index to -1 in pimd DB so next if up event VIF receives new vif_index and reprograms in kernel. 2. during mroute del sequence reset mfcc_parent to MAXVIF. 3. during mroute add check if parent mfcc_parent is MAXVIF then do not download to kernel such mroute entry. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-01-30pimd: Cleanup shutdown a bit more.Donald Sharp
Cleanup the shutdown of pim a bit more. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-17Merge remote-tracking branch 'origin/master' into pim_lib_work2Donald Sharp
2016-12-21pimd: Remove unused zclient_debug variableDonald Sharp
Remove code that sets the pim_zclient_debug variable but is never used. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Cleanup nexthop debuggingDonald Sharp
When debugging nexthops, we print allot of unnecessary data Move some debugs to trace detail to reduce log clutter. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Be more careful looking up mroute statisticsDonald Sharp
When we get a request to look up the mroute statistics from the kernel, ensure that the interface returned is a valid usable interface. 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: Don't ask for information when you are notgoing to get an answerDonald Sharp
When we have intentionally not installed a mroute( for whatever reason ), do not ask for information about that mroute from the kernel when it happens. Ticket: CM-12986 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>