summaryrefslogtreecommitdiff
path: root/pimd/pim_assert.c
AgeCommit message (Collapse)Author
2022-05-12pimd: Disable receiving assert msg on passive interfacesarita patra
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12pimd: Handling assert send statistics for passive interfacesarita patra
Increment pim_ifstat_assert_send only when interface is passive disabled. Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-06pimd: un-dependency-hell `pim_instance.h`David Lamparter
This is causing build issues on BSD by including (transitively) `linux/mroute6.h` - try to address by disentangling the headers a bunch. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-20Merge pull request #10853 from plsaranya/pim_assert_fixesDonald Sharp
pimd: assert fixes
2022-03-29pimd: RPF change after winner electionplsaranya
Problem: Once Assert election is over and winner is elected, the downstream router has to prune from the upstream LOSER if it has joined already and have to join with upstream elected WINNER pim_rpf_update function takes care of changing the rpf_ch if the existing one is PIM_IFASSERT_I_AM_LOSER Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-03-28pim6d: include IPv6 pseudoheader in TX checksumsDavid Lamparter
Lots of passing src/dst around, but it is what it is. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14pim6d: IPv6-adjust pim_ifchannel_*David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust assert-related addrsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust various pim_sgaddr usesDavid Lamparter
Since `pim_sgaddr` is `pim_addr` now, that causes a whole lot of fallout anywhere S,G pairs are handled. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: more TLV parse/encode IPv6 preparationDavid Lamparter
More proliferation of pim_addr to work towards IPV6. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: replace pim_inet4_dump with `%pPAs`David Lamparter
Only pim_sgaddr uses are covered by this since regular in_addr is still used for singular addresses, so only a part of pim_inet4_dump calls are gone with this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: `prefix_sg` => `pim_sgaddr`David Lamparter
Mostly just 2 sed calls: - `sed -e 's%struct prefix_sg%pim_sgaddr%g'` - `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'` Plus a bunch of fixing whatever that broke. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-10pimd: Modify in_addr to pim_addr in pim_assert_metricMobashshera Rasool
This change is to accomodate IPv6 and IPv4 in the same code. Based on pimd or pim6d, this will be compiled. Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-01-10pimd: Modifying in_addr to pim_addr in struct pim_ifchannel for IPv6.Mobashshera Rasool
Changed struct in_addr ifassert_winner to pim_addr which will be used in both IPv4 and IPv6(Both MLD and IGMP). Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-04-23pimd: zassert => assertDavid Lamparter
No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-09-10pimd: Slightly loosen pim assert message length testsDonald Sharp
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>
2019-07-01*: s/TRUE/true/, s/FALSE/false/Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-19pimd: ALLOC functions cannot fail.Donald Sharp
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>
2019-05-14pimd: PIM Msg header includes N bit as defined by RFCsaravanank
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>
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-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
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: 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-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-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-01pimd: Introduce show command for protocol countersChirag Shah
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>
2017-02-24pimd: Assume buffer size passed in is of sufficient sizeDonald Sharp
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>
2017-01-19pimd: Cleanup the headers.Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-17Merge remote-tracking branch 'origin/master' into pim_lib_work2Donald Sharp
2016-12-21pimd: Rework zassert code in pim_assert.cDonald Sharp
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>
2016-12-21pimd: Allow storing of sg in string formatDonald Sharp
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>
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: Ensure 'struct prefix sg' is inited in right orderDonald Sharp
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>
2016-12-21pimd: Modify pim_parse_addr_group to use 'struct prefix_sg'Donald Sharp
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>
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: Further work to fix rpf lookups and nbrsDonald Sharp
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>
2016-12-21pimd: Fix pim to use correct src address for packetsDonald Sharp
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>
2016-12-21lib, pimd: Fix borked up prefix codeDonald Sharp
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>
2016-12-21pimd: Remove unnecessary QuaggaIdDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: more source,group conversion to prefix sgDonald Sharp
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>
2016-12-21pimd: Convert ifchannel to using a prefix to store (s,g)Donald Sharp
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>
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-07-12pimd: Refactor some encode/decode functionsDonald Sharp
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>
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>