summaryrefslogtreecommitdiffstats
path: root/pimd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pimd: Free up zlookup structure lateDonald Sharp2019-03-141-2/+2
| | | | | | | When we are shutting down, delay the zlookup free to as late as possible since we may need it still Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #3907 from donaldsharp/pim_electionDavid Lamparter2019-03-111-4/+4
|\ | | | | pimd: Ensure DR election happens when both sides change prio
| * pimd: Ensure DR election happens when both sides change prioDonald Sharp2019-03-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose we have 2 routers A and B. Both Router A and B have the same priority of 1000. Router A is the elected DR. Now suppose B lowers his priority to 1. He still looses the DR election and we are not sending a hello with the new priority. Immediately after this A's priority is also lowered to 1, it looses the election and sends the hello. B receives this hello and elects A as the DR( since it has the better ip address) At this point A believes B is the DR, and B believes A is the DR until such time that the normal hello from B is sent to A, which if timed correctly can be a significant amount of time). This code just causes a hello to be sent if the priority is changed. Now both sides will be able to converge quickly Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #3869 from qlyoung/cocci-fixesDavid Lamparter2019-03-066-13/+7
|\ \ | |/ |/| Assorted Coccinelle fixes
| * *: remove null check before XFREEQuentin Young2019-02-265-12/+6
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * *: use array_size instead of raw divisionQuentin Young2019-02-261-1/+1
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | pimd: strncpy -> strlcpyQuentin Young2019-02-261-2/+2
|/ | | | | | strncpy is a byte copy function not a string copy function Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: Rename backet to bucketTim Bray2019-02-252-4/+4
| | | | | | Presume typo from original author Signed-off-by: Tim Bray <tim@kooky.org>
* pimd: Add 'test pim keepalive-reset A.B.C.D A.B.C.D' commandDonald Sharp2019-02-211-1/+52
| | | | | | | | | | | | | | | | | | | | | Add a test command to pim that allows you to reset the keepalive timer for an upstream to it's max value. This is to allow purposeful testing of cleanup code in pim, by forcing the keeaplive timer to expire later. robot# show ip pim upstream Iif Source Group State Uptime JoinTimer RSTimer KATimer RefCnt enp3s0 192.168.201.136 225.1.0.0 NotJ,RegP 00:00:10 00:00:52 00:00:25 00:02:54 1 robot# show ip pim upstream Iif Source Group State Uptime JoinTimer RSTimer KATimer RefCnt enp3s0 192.168.201.136 225.1.0.0 NotJ,RegP 00:00:11 00:00:51 00:00:24 00:02:53 1 robot# test pim keep 192.168.201.136 225.1.0.0 Setting (192.168.201.136,225.1.0.0) to current keep alive time: 210 robot# show ip pim upstream Iif Source Group State Uptime JoinTimer RSTimer KATimer RefCnt enp3s0 192.168.201.136 225.1.0.0 NotJ,RegP 00:00:27 00:00:35 00:00:08 00:03:27 1 robot# Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #3760 from patrasar/RP_configure_inconsistent_addr_maskDonald Sharp2019-02-083-11/+28
|\ | | | | pimd: reject inconsistent address/mask "ip pim rp command"
| * pimd: reject inconsistent address/mask "ip pim rp command"Sarita Patra2019-02-083-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: Configure "ip pim rp x.x.x.x 225.0.0.0/4". Show running config shows "ip pim rp x.x.x.x 224.0.0.0/4" This is mis-leading. Root-cause: Internally 225.0.0.0/4 is getting converted to 224.0.0.0/4 group mask, since the prefix length is 4. Fix: Restrict the user to configure inconsistent group address mask by throughing a cli error "Inconsistent address and mask". Signed-off-by: Sarita Patra <saritap@vmware.com>
* | pimd: Don't refersh the oif_creation timer if S,G already presentSarita Patra2019-02-081-2/+4
|/ | | | | | | | | | | | | | | | Issue: Shut the RP interface in the router RP. LHR will get to know RP becomes not-reachable, so it send a prune towards the RP. On receiving the prune, RP clear the (*, G) entry, but (S, G) should not get removed if present. Now no-shut the RP interface in the router RP. LHR will send a (*, G) join towards the RP. On receiving join FRR create the (*, G) entry. Along with this, it also add the interface(join received) in the OIL of (S, G) and also refresh the (S, G) timer. Fix: Dont refresh the timer for S, G or (*, G), if the flag for the channel OIL is PIM_OIF_FLAG_PROTO_ANY. Signed-off-by: Sarita Patra <saritap@vmware.com>
* pimd: Pim is not respecting the move of an interface from old->new vrfDonald Sharp2019-02-051-0/+22
| | | | | | PIM needed to be updated to move to the new vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Add hidden 'ip pim active-active` commandDonald Sharp2019-01-315-0/+41
| | | | | | | | Add a command to track if an interface should be in active-active mode or not. This command is hidden at this time because it is not finished fully. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* build: fix a whole bunch of *FLAGSDavid Lamparter2019-01-301-1/+1
| | | | | | | | | - some target_CFLAGS that needed to include AM_CFLAGS didn't do so - libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all - consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@ - 2 dependencies were missing for clippy Signed-off-by: David Lamparter <equinox@diac24.net>
* pimd: Convert to using an ifindex_t for the vifDonald Sharp2019-01-251-1/+1
| | | | | | Let's stay consistent in the data type for the vif index Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Prevent crash from using pim static mroutesDonald Sharp2019-01-251-1/+1
| | | | | | | | | | | If you have an interface being added to a static mroute and that interface has been configured w/ pim but does not have a valid ip address yet, we do not create a VIF for that device yet. As such when we attempt to assign the vif array in the pim static data structure we attempt to write into -1 of that array. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Treewide: use ANSI function definitionsRuben Kerkhof2019-01-244-9/+9
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* pimd: Allow pim to display what it believes the mlag role is.Donald Sharp2019-01-041-0/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Store the router mlag roleDonald Sharp2019-01-042-3/+5
| | | | | | When we are told about the mlag role, store it for later usage. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Remove pimgDonald Sharp2019-01-044-11/+7
| | | | | | | | The pimg data structure is only used in one spot to send the default vrf id to zebra upon startup. Add the default vrf id to the struct pim_router data structure and remove the pimg pointer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Remove pim_msdp_config_write as it was never usedDonald Sharp2019-01-043-11/+5
| | | | | | | This function was never used, additionally rename the _helper function to this name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Move register_probe_time to pim_routerDonald Sharp2019-01-044-4/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Move packet_process variable to pim_routerDonald Sharp2019-01-047-8/+8
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Move register_suppress_time into struct pim routerDonald Sharp2019-01-046-8/+9
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Convert rpf_cache_refresh_delay_msec into pim_router structDonald Sharp2019-01-045-6/+6
| | | | | | | Move the rpf_cache_refresh_delay_msec into the pim_router since it should own the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Move the infinite_assert_metric global to pim_routerDonald Sharp2019-01-046-20/+22
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Convert qpim_t_periodic into the `struct pim_router` structureDonald Sharp2019-01-048-14/+14
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Move debugs into pim_router structureDonald Sharp2019-01-043-82/+102
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Create a `struct pim_router` and move thread master into itDonald Sharp2019-01-0417-58/+87
| | | | | | | | 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>
* pimd: Add the reading of capabilities on startup.Donald Sharp2019-01-041-0/+8
| | | | | | | Just add the ability to notice the capabilities on startup, but don't do anything with it yet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: When we fail to initiate ifchannel backout work doneDonald Sharp2018-11-161-0/+8
| | | | | | | | | When we receive a igmp report and attempt to initiate a pim ifchannel for it and that fails to work then let's back out the work done setting stuff up to this point. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Add some debugs for when local membership failsDonald Sharp2018-11-161-2/+17
| | | | | | | | When we fail to add a local membership add some additional debugs so that we can have a bit more information on when something goes bad. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Replace zclient_new with zclient_new_notifyDonald Sharp2018-11-122-2/+2
| | | | | | | 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>
* pimd, zebra: Encode nexthop vrf in messageDonald Sharp2018-11-022-2/+6
| | | | | | Encode the nexthop vrf in the message sent about mrib lookups. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #2705 from opensourcerouting/northbound-yang-v2Donald Sharp2018-10-311-1/+6
|\ | | | | Northbound API
| * yang, lib: add 'frr-interface.yang' and associated stub callbacksRenato Westphal2018-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce frr-interface.yang, which defines a model for managing FRR interfaces. Update the 'frr_yang_module_info' array of all daemons that will implement this module. Add automatically generated stub callbacks in if.c. These callbacks will be implemented in the following commit. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * *: add empty array of YANG modulesRenato Westphal2018-10-271-1/+5
| | | | | | | | | | | | | | | | | | | | FRR_DAEMON_INFO should now contain an array of 'frr_yang_module_info' structures describing the YANG modules implemented by the daemon. This array will be used by frr_init() function to load all YANG modules and initialize the northbound callbacks during the daemon initialization. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | pimd: Send 1 on all systems for MRT_INITDonald Sharp2018-10-311-10/+15
| | | | | | | | | | | | | | | | | | When sending a sockoption for MRT_INIT, *bsd requires that the data passed in must be 1. While linux does not, the code was sending in a positive value that was causing issues on *bsd of protocol not supported. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: *bsd needs priviledge escalation to init PIMDonald Sharp2018-10-311-9/+13
|/ | | | | | | | | | | When trying to run PIM on *bsd, the kernel expects to only allow the pim kernel socket to work if we elevate priviledges. So do so. This commit gets us further in the startup of PIM on *bsd but is not sufficient to get it fully started yet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #3227 from qlyoung/fix-exit-vrf-placement-upstreamDavid Lamparter2018-10-261-1/+1
|\ | | | | vtysh: fix exit-vrf printing
| * vtysh: fix exit-vrf printingQuentin Young2018-10-241-1/+1
| | | | | | | | | | | | | | | | Resolves issue with exit-vrf being placed at the end of zebra's portion of a vrf block, but before other daemons' portions of the same config block. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: spelchekDavid Lamparter2018-10-252-2/+2
|/ | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: Replace hash_cmp function return value to a boolDonald Sharp2018-10-197-14/+14
| | | | | | | | | The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: list_delete_and_null() -> list_delete()David Lamparter2018-10-0214-31/+31
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* pimd: Fix several address sanitizer issuesDonald Sharp2018-09-242-4/+5
| | | | | | | | | | | | | | | | | This commit fixes two issues during pim shutdown. 1) The rp_info structure was being freed before the outgoing notifications that depended on it's information was sent out as part of shutdown. 2) The pim->upstream_list shutdown involved iterating over the list via ALL_LIST_ELEMENTS. This typically is enough but pim will auto delete child nodes as well as itself when it goes away and they depend on it. As such the node and nnode could possibly already have been freed. So change the way we look at all the data in the upstream_list Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Why was pim including zebra headers?Donald Sharp2018-09-233-5/+0
| | | | | | Remove the inclusion of zebra headers from pim. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: blackhole traffic when we are not DR for Stream receivedDonald Sharp2018-09-211-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose we have a bridge with a host and two routers attached to it. r1 r2 | | -------- | host host is sending traffic. r1 and r2 are pim neighbors and r2 is the DR. Both r1 and r2 will receive data from the stream up the pim kernel socket. r1 will notice that it is not the DR and stop processing in pim. This code adds a bit more code to blackhole the route when r1 detects it is not the DR in this scenario. This is being done because the kernel is both keeping state and sending data to the pim process to continue processing this. Additionally if we happen to be running this on a asic, then blackholing the route in the asic can save a significant amount of cpu time handling this situation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Add a debug to tell why we are not creating upsteam stateDonald Sharp2018-09-211-2/+7
| | | | | | | | When we decide we are not the right pim process to add upstream state for the igmp state received, notice this in a debug to make life easier to debug. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Add some extra information to a show commandDonald Sharp2018-09-211-2/+3
| | | | | | | | The tracking of who have drpriority on an interface in pim was not displayed anywhere. Add to the show command for future reference. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>