summaryrefslogtreecommitdiffstats
path: root/pimd/pim_assert.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis2020-03-051-39/+35
| | | | | | Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* pimd: Slightly loosen pim assert message length testsDonald Sharp2019-09-101-2/+2
| | | | | | | | | | | | | | | | | The Pim RFC does not appear to state any length requirements of pim, other than the checksum must be correct. Certain vendors are sending extra data at the end of a pim assert message. This while not explicitly against the rules was a bit of surprise to pim when we threw the assert message on the floor for being too long. Modify the test to see if length left will allow us to read the 8 bytes of data that we need. If it is sufficient for that allow the packet to be used. Fixes: #4957 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: s/TRUE/true/, s/FALSE/false/Quentin Young2019-07-011-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* pimd: ALLOC functions cannot fail.Donald Sharp2019-06-201-6/+0
| | | | | | | | 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>
* pimd: PIM Msg header includes N bit as defined by RFCsaravanank2019-05-151-1/+1
| | | | | | | | This commit includes parsing of Nbit and contructing pim hdr with Nbit Adding Nbit to PIm hdr structure Adding Scope zone bit and Bidir bit to Encoded IPv4 Group Address Signed-off-by: Saravanan K <saravanank@vmware.com>
* pimd: Create a `struct pim_router` and move thread master into itDonald Sharp2019-01-041-1/+1
| | | | | | | | 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>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-3/+3
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* pimd: Fix code to not send joins when SGRPT Prune is receivedDonald Sharp2017-07-241-1/+1
| | | | | | | | | | | | | | | 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>
* pimd: Remove pimg from pim_upstream.cDonald Sharp2017-07-241-4/+5
| | | | | | | 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>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-3/+3
| | | | | | | | | 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>
* *: reindent pt. 2whitespace / reindent2017-07-171-3/+3
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-553/+542
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-18/+17
| | | | | | | | | | | 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>
* *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* pimd: Introduce show command for protocol countersChirag Shah2017-05-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For all pim enabled interfaces and single pim enable interface command. Clear command to clear protocol counters stats. 'show ip pim interface traffic {WORD} {json}' 'clear ip pim interface traffic' Testing Done: bringup Pim configuration and form RPT and SPT and check show ip pim interface traffic command output, perform clear form of interface traffic command and verified all counters reset via show form of command. tor-21# show ip pim interface traffic swp2 Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx --------------------------------------------------------------------------------------------------------------- swp2 22/22 0/10 0/0 0/0 0/0 0/0 leaf-22# show ip pim interface traffic swp3 Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx --------------------------------------------------------------------------------------------------------------- swp3 23/22 10/0 0/0 0/0 0/0 0/0 spine-1#show ip pim interface traffic Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx --------------------------------------------------------------------------------------------------------------- br1 0/1 0/0 0/0 0/0 0/0 0/0 lo 0/0 0/0 0/0 0/0 0/0 0/0 swp1 0/1 0/0 0/0 0/0 0/0 0/0 swp2 0/1 0/0 0/0 0/0 0/0 0/0 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* pimd: Assume buffer size passed in is of sufficient sizeDonald Sharp2017-02-241-6/+2
| | | | | | | | | | | | | | | | | | For: pim_msg_build_header pim_msg_addr_encode_ipv4_ucast pim_msg_addr_encode_ipv4_group pim_msg_addr_encode_ipv4_source Assume that the buffer size passed in is of sufficient size already. This is assured already because buffer sizes are checked for minimum lengths for the entire packet ahead of time. So we are double checking. Additionally at scale we will be calling these functions a very very large number of times. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Cleanup the headers.Donald Sharp2017-01-191-4/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge remote-tracking branch 'origin/master' into pim_lib_work2Donald Sharp2017-01-181-0/+3
|\
| * build: remove $Format tagsDavid Lamparter2016-12-201-2/+0
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pimd: Rework zassert code in pim_assert.cDonald Sharp2016-12-221-35/+53
| | | | | | | | | | | | | | | | | | | | When we encounter an error in the state machine for an individual ifchannel, do not bring the entirety of the pim daemon down. Notice the issue and continue on. Ticket-CM-13939 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Allow storing of sg in string formatDonald Sharp2016-12-221-13/+13
| | | | | | | | | | | | | | | | Debugs are extremely expensive currently. Let's store 'struct prefix_sg sg' string format in the ifchannel, upstream and msdp_sa structures. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Remove unnecessary assertsDonald Sharp2016-12-221-3/+0
| | | | | | | | | | | | | | | | | | 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>
* | pimd: Ensure 'struct prefix sg' is inited in right orderDonald Sharp2016-12-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | When we called pim_parse_addr_group, don't reinitialize the 'struct prefix_sg' *after* we've parsed the group. Ensure in other places that we do this work, we initialize prior as well. Ticket: CM-13510 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Modify pim_parse_addr_group to use 'struct prefix_sg'Donald Sharp2016-12-221-4/+4
| | | | | | | | | | | | | | | | Modify the pim_parse_addr_group to use 'struct prefix_sg sg'. This is the first of 2 commits to clean up this parsing to be a bit better. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton2016-12-221-11/+11
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | pimd: Further work to fix rpf lookups and nbrsDonald Sharp2016-12-221-1/+1
| | | | | | | | | | | | | | | | | | When we do a RPF lookup return a path that we have neighbors for in those cases where we need to have a neighbor to pass along the SG state via a pim join/prune message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Fix pim to use correct src address for packetsDonald Sharp2016-12-221-0/+1
| | | | | | | | | | | | | | | | | | When sending register packets to the RP from the FHR we should be using the ip address of the incoming interface that received the mcast packet. Ticket: CM-12445 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | lib, pimd: Fix borked up prefix codeDonald Sharp2016-12-221-6/+6
| | | | | | | | | | | | | | Fix the struct prefix to be an actual struct prefix_sg. This cleans up a bunch of code to make it look nicer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Remove unnecessary QuaggaIdDonald Sharp2016-12-221-1/+0
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: more source,group conversion to prefix sgDonald Sharp2016-12-221-13/+9
| | | | | | | | | | | | | | Convert more of the code to pass around a 'struct prefix sg' instead of individual struct addr's. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Convert ifchannel to using a prefix to store (s,g)Donald Sharp2016-12-221-81/+32
| | | | | | | | | | | | | | | | Convert ifchannel to use a prefix to store (s,g) information. Additionally create pim_str_sg_dump function to output data when using debugs. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Fix use of 0 for NULLDonald Sharp2016-12-221-1/+1
|/ | | | | | | pimd uses allot of 0's to represent NULL. Not a good programming practice. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Refactor some encode/decode functionsDonald Sharp2016-07-131-6/+2
| | | | | | | | Some encode/decode functions are needed in multiple places. Start the refactoring to be able to use them in a more generic manner. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Separate pim vif index spot from ifindexDonald Sharp2016-06-181-0/+1
| | | | | | | | | 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>
* pimd: Add SPTbit(S,G) supportDonald Sharp2016-05-261-2/+3
| | | | | | | Add code to allow pimd to store the SPTbit as needed and to properly test against it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: merge pimd as of 2015-01-19David Lamparter2016-05-261-0/+808
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>