summaryrefslogtreecommitdiff
path: root/pimd/pim_rp.c
AgeCommit message (Collapse)Author
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
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-09-04bgpd, ospfd, pimd, zebra: Convert more use_json locations to boolDon Slice
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-16Merge pull request #2849 from patrasar/memory_leak_nhtRuss White
Fix memory leak pim nexthop creation
2018-08-16pimd: Fix memory leak pim nexthop creationSarita Patra
While terminating pim instance, the memory allocated for pim nexthop should be released before deallocating the memory of pim nexthop cache(pnc). This resolves the memory leak detected in pnc->nexthop creation. Signed-off-by: Sarita Patra <saritap@vmware.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-08-11*: ALLOC calls cannot failDonald Sharp
There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-06bgpd pimd: return check (Coverity 1472232 1472234)F. Aragon
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-08-02pimd: Cleanup rp_info->plistDonald Sharp
PIM is leaking the plist data structure in some shutdown cases. Additionally trust XFREE Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-23libs, daemons: use const in route-map applyMark Stapp
Use 'const prefix *' in route-map apply apis; led to some corresponding changes in several daemons. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-07-19Merge pull request #2635 from donaldsharp/more_pim_neighborJafar Al-Gharaibeh
More pim neighbor
2018-07-08pimd: Remove unnecessary alloc failuresDonald Sharp
Remove from pim unnecessary alloc failure testing as that alloc failure will cause an assert. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-07pimd: Fix up > 80 columnsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-07pimd: Make code consistent in regards to lookupDonald Sharp
In places where we do a pim_ecmp_nexthop_search, also use pim_ecmp_nexthop_lookup instead of the single path case of pim_nexthop_lookup. This is in preparation of more serious surgery to fix the weird api of pim_find_or_track_nexthop. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-04pimd: Fix debug messagesMartin Buck
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-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-27pimd: Some compilers are complaining about my bpDonald Sharp
Fix the bp variable possibly ( yeah not really ) be initialized upon use. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-26Merge pull request #1069 from donaldsharp/rfc_plistPhilippe Guibert
PIM: allow overlapping group ranges for prefix-list and static RP's
2017-09-14pimd: Add new 'debug pim nht rp' commandDonald Sharp
All the rp debugs were a mish-mash of TRACE or ZEBRA, but the reality they were all focused on handling NHT issues associated with the RP's. So let's create a new debug 'debug pim nht rp' if you are having issues with RP's. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31pimd: Add ability to lookup RP group by table.Donald Sharp
This feature does this: Add the ability to store the non-prefix static RP entries into a table. Then to lookup the G to find the RP in that table, finding the longest prefix match across both prefix-lists and static RP's. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31pimd: Match on longest prefix when searching for RPDonald Sharp
When we are searching for a RP to use, amongst many RP's and separate prefix-lists, Match on the longest prefix specified to choose the correct RP. Example: ip pim rp 4.3.2.1 prefix-list A ip pim rp 4.3.2.2 prefix-list B ip pim rp 4.3.2.3 prefix-list C ip prefix-list A seq 5 permit 225.0.0.0/8 ip prefix-list B seq 5 permit 225.1.0.0/16 ip prefix-list C seq 5 permit 225.1.1.0/24 Old behavior: Group 225.1.1.14 comes in and we need to find the RP to use, we would match on the first prefix-list A( since we are searching based on a sorted link list of RP address ) and select 4.3.2.1 as our RP New behavior: Group 225.1.1.14 comes in and we need to find theRP to use, we now will match on C( longest prefix match ) and select 4.3.2.3 as our RP. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31pimd: Improve handling in pim_rp_initDonald Sharp
When we are starting up improve the error handling of pim_rp_init and fix some memory leaks. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24pimd: Cleanup a variety of SA issuesDonald Sharp
1) Error check return from setsockopt and sockets 2) Check return codes for str2prefix 3) Clean up some potential NULL References Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25pimd: NHT upstream list is inefficientDonald Sharp
The NHT upstream list at scale is horribly inefficient due to keeping a sorted list of upstream entries. The attempting to find the upstream and the insertion of it into the upstream_list was consuming a large amount of cpu cycles. Convert to a hash, allow add/deletions to effectively become O(1) events. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25pimd: Clean PNC cache handling on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Put 'struct pim_instance *' as the first function parameterDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Convert pim_cmd.c to use correct pim instanceDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Add code to write spaces or not before 'ip pim rp'Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Make msdp `struct pim_instance *` awareDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Convert pim_rp.c to use 'struct pim_instance *'Donald Sharp
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-24pimd: Remove pimg from pim_nht.c in totalityDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Add 'struct pim_instance' to find_or_track_nexthopDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Make nexthop cache pim instance awareDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Refactor some functionsDonald Sharp
A bunch of functions had return values that were never checked for ( and not needed ) and opposite return values for proper calling function boolean logic. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Refactor code to be in better spotsDonald Sharp
1) Create pim_instance.[ch] to allow us to handle the instance information there 2) Refactor some pim_rpf_ and some pim_rp commands into appropriate files and appropriate includes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Error check str2prefixDonald 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>