summaryrefslogtreecommitdiff
path: root/pimd/pim_pim.c
AgeCommit message (Collapse)Author
2018-08-14pimd: Add pim_errors and define some pim specific errorsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-20bgpd isisd ldpd lib ospfd pimd: redundancy (infer)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-04-30pimd: Cleanup pim_if_is_loopbackDonald Sharp
The interface itself knows if it is a vrf device or not, so let's just use a check for that in the decision if a interface is a loopback or not. Additionally modify function to return a bool. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix crash when looking up incoming interfaceDonald Sharp
It is possible that the incoming interface lookup will fail because we are in transition from one vrf to another. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: When we are initializing a pim socket limit hellosDonald Sharp
When we are initializing a pim socket for vrf or loopback interfaces do not schedule a hello to go out at all. I'm currently leaving the check on is a vrf / loopback device on the actual send as that we have several paths to get there. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Ensure packet received on vrf interface is configured for pimDonald Sharp
In a vrf configuration, when we receive a pim packet we lookup the correct incoming interface. There exists a chance that the correct incoming interface has not been configured to use pim yet. gracefully bow out and do nothing with the packet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Reschedule the correct interface for incoming packetsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Trust the recvfromto ifindex informationDonald Sharp
The vrf interface is receiving the pim packet instead of the slave interface that is bound. Lookup the ifindex ifp pointer from that. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Don't send hello's out vrf interfaceDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Cleanup pim_pim use of pimgDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Remove pimg from pim_register.cDonald 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-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-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-04-05Merge branch 'master' into pim_5549Donald Sharp
2017-03-31pimd: Cleanup unused variable writeDonald Sharp
There exists a common pattern in pim where we were setting a variable to a value in the error case when we would no longer need it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30pimd: Send v6 secondary addresses to neighbors in helloDonald Sharp
Send v6 secondary addresses to our neighbor in hello's. Additionally allow the disabling it via the cli introduced earlier. 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-24pimd: Trust the compilerDonald Sharp
When we set a variable to NULL, there is no need to assert on it the following line. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-24pimd: Remove unnecessary ip header length checks on receipt.Donald Sharp
The kernel will not hand us a malformed packet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-24pimd: Remove unnecessary check in packet process pathDonald Sharp
When we get a packet from the network for pim, we do not need to check to see that it is a pim packet, since that is what we've asked to receive. Signed-off-by: Donald Sharp <sharpd@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-02-24pimd: Add 'struct pim_msg_header' packed data structure.Donald Sharp
Add the 'struct pim_msg_header' and convert all places that encoded/decoded the message header to use it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-14pimd: Allow IPDEFTTL to be used for omniosDonald Sharp
The omnios OS has no IPDEFTTL defined. Add the ability to handle it for this one case. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-14pimd: messages to neighbors should have TTL = 1Chirag Shah
Ticket:CM-12924 Reviewed By:shapd Testing Done: configure PIM neighbor, verify PIM hello packet dump for ttl to be 1. Set TTL to 1 for outgoing multicast control packets destine to ALL-PIM-ROUTERS as oppose to unicast mcast packets. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-02-14pimd: non-null register checksum incorrectChirag Shah
Ticket: CM-12041 Reviewed By: sharpd, CCR-5556 Testing Done: Tested on Local setup generating PIM Register (Data/Null) and processing both Tx/Rx with correct checksum. Provided quagga debian to submitter and checksum cases passed on submitter setup. 1. PIM Register msg checksum only accounts for 8 bytes (4 bytes for PIM header and next 4 byetes before data payload). In PIM header checksum calculation checked PIM packet type (in this case REGISTER type) then only pass 8 bytes as length rather than full packet length. 2. PIM Register Rx path also handled with 8 byte and full pim lenth checksum. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-02-03pimd: Refactor pim_sock_open to just need the ifp pointerDonald Sharp
In all cases pim_sock_open was called, we just passed in the pim_ifp->primary_address, which is accessible from the interface pointer. So just pass that in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-03pimd: Allow a interface in a vrf to be configured.Donald Sharp
This fixes the issue a crash when we have configured an interface inside of a vrf, and apply pim commands to it. 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: Add guard for pim_msg_send_frameDonald Sharp
In certain error conditions it is possible to attempt to send packets when the socket is not ready instead of dumping to the log a million error messages only note the issue if we have packet debugs on. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Lower Hello sent to be immediateDonald Sharp
There exists situations where an interface flaps and routing recovers and we attempt to install an upstream but since we have no neighbor out that interface still. Let's cause the hello to go out immediately for the 3.1 release to allow mrouting to recover in this situation. We will need to revisit this issue after we have proper nexthop tracking in place Ticket: CM-13185 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pimd: Add knob to control # of packets read in at one timeDonald Sharp
Add 'ip pim packets <1-100>' command. Allows you to control the number of packets read in before giving control back to another part of the process. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Modify pim_sock_read to read 3 times before yieldingDonald Sharp
Modify pim_sock_read to read up to 3 packets before yielding the cpu to something else. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Further refine debugs in pim_sock_read pathDonald Sharp
When we received a packet we were dumping packet information with debugs on 2 times for each packet where we had overlapping data being passed. Since debugs are expensive, reduce the count to 1. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Cleanup handling of pim_sock_readDonald Sharp
Cleanup some turned on debug code that is no longer needed to be turned on in the pim_sock_read code path. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Protect log messages with debug in pim_pim.cDonald Sharp
Protect the log messages in pim_pim.c with PIM_DEBUG_PIM_PACKETS 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: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21pimd: Allow bigger packet sizes when receiving callbacks.Donald Sharp
When receiving callbacks from the kernel allow bigger packet sizes than 3k to be handled appropriately. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix high cpu load of pim when interface goes downDonald Sharp
When a interface goes down we accidently put ourselves into an infinite loop. Ticket: CM-12803 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Allow breaking up of packet.Donald Sharp
When a packet is too large to send in one go, break it up. Ticket: CM-12768 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix double close of socket.Donald Sharp
When a interface bounces fix the double close from happening 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-21pimd: Remove unnecessary QuaggaIdDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: change string to JOINPRUNEDonald Sharp
Change the JP message string to JOINPRUNE. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Refactor pim message type to an enumDonald Sharp
Change the pim message type to an enum and add the ability to output a string based upon message type. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: First Schwag at pim_register_stopDonald Sharp
Implement the pim_register_stop state machine. There are still a few bugs still but this is enough to get us rolling a bit more. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>