summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
AgeCommit message (Collapse)Author
2019-09-19*: Add infrastructure to support zapi interface callbacksDonald Sharp
Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. 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-30Merge pull request #4369 from patrasar/lmqc_lmqtDonald Sharp
pimd: new cli to configure last-member-query-count & last-member-quer…
2019-05-29pimd: new cli to configure last-member-query-count & last-member-query-intervalSarita Patra
Introduce new cli commands ip igmp last-member-query-count <1-7> ip igmp last-member-query-interval <1-255> deciseconds. Display the config in show running config and show ip igmp interface Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-05-14pimd: Enable BSM processing on all interfaces by defaultsaravanank
set the flags for bsm processing and unicast bsm processing to true during pim interface creation
2019-04-20pimd: update vxlan mroute entries when the lo or peerlink vif is updatedAnuradha Karuppiah
For vxlan origination mroutes the IIF is pinned to a. lo for single VTEPs b. peerlink-rif for anycast VTEPs This commit includes the changes to react to pim-vifi add/del for these devices. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20pimd: API for enabling pim on the vxlan term device ipmr-loAnuradha Karuppiah
ipmr-lo is a dummy netdev with no additional addressing requirements - root@TORS1:~# ip -d link show ipmr-lo 28: ipmr-lo: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default link/ether 12:5a:ae:74:51:a2 brd ff:ff:ff:ff:ff:ff promiscuity 0 dummy addrgenmode eui64 root@TORS1:~# This device is used by pim-vxlan to signify multicast-vxlan-tunnel termination. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-02-25*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-01-31pimd: Add hidden 'ip pim active-active` commandDonald Sharp
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>
2019-01-04pimd: Convert qpim_t_periodic into the `struct pim_router` structureDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-17pimd: use bool instead of int to pass true/falseDonald Sharp
In pim_if_new use bool instead of an int to pass true/false values for what we should create the pim interface type for. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-17pimd: Actually create vif's in non-integrated configDonald Sharp
The startup of a non-integrated config was not properly allowing for startup to create the vif when we have not learned about the interface we are trying to configure at this point in time. Actually notice when we are trying to create a pimreg device or not to properly notice when to attempt to create the vif or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-23zebra: if multiple connecteds, select loopback or vrf if presentDon Slice
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-02pimd: pim_socket_join_source is only called from one placeDonald Sharp
The pim_socket_join_source function only ever calls pim_igmp_join_source and pim_socket_join_source is only called from 1 place. Skip the level of indirection. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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-05-11pimd: Cleanup all pim_ifp pointers on terminationDonald Sharp
Properly cleanup pim_ifp pointers on termination Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-30pimd: Remove expensive lookup for if a device is a vrf deviceDonald Sharp
Interfaces know if they are a vrf device or not and this data is passed up to the protocol. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
2018-03-08pimd: mtrace only IGMP socketsMladen Sablic
Feature of mtrace only IGMP sockets on pim sm and pim ssm interfaces. Modifed IGMP socket creation and show igmp interface command output. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-23*: Make assignment from RB_ROOT in while loop work betterDonald Sharp
Fix up the assignment of the variable = RB_ROOT inside of while loop patter we were using. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-14pimd: Fix memory allocation errorDonald Sharp
When creating the pim_ifp, and we run out of memory there existed a chance that we would dereference the failed memory pointer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25pimd: Cleanup vrf SA issues exposed by recent commitsDonald Sharp
A recent commit has shown that we were not consistent with handling of the vrf lookup. Adjust pim to do the right thing with vrf lookup to be consistent and to make SA happier. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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-10lib: nuke the if_*_by_name_len() functionsRenato Westphal
Make use of strnlen() and strlcpy() so we can get rid of these convoluted if_*_by_name_len() functions. 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-26pimd: add support for boundariesQuentin Young
Adds the ability to filter PIM Joins & IGMP reports on an interface. Enabling a multicast boundary on an interface for a particular group will prevent the interface from appearing in the group's OIL. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-18pimd: Do not complain if re-joining an IGMP groupDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> If you cut-n-paste an existing "ip igmp join 233.200.0.0 0.0.0.0" command under an interface we should not return an error.
2017-09-15*: use clang's 'ForEachMacros' format style optionRenato Westphal
This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-14pimd: Allow igmp join messages to return more detailed errorsDonald Sharp
Start the conversion of pim configuration commands to use the ferr side channel to allow more detailed information to be returned to cli commands. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-03pimd: Fix crash on iface down due to secondary address listDonald Sharp
The secondary address list was being added/removed as we went. I see no reason to have special bookkeeping for this list. Just add it on interface startup and then remove it on deletion. Removes some very specialized coding that was saving a very small amount of space. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Squash some more memory leaksDonald Sharp
When a interface is flapped we were leaking some memory associated with link lists. Especially in the jp_agg code. If your network was/is stable and you are not running at any scale you probably would not see this as impactful at all. Ticket: CM-16392 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Convert to using a RB tree for the pim_ifp ifchannel_listDonald Sharp
This patch does two things: 1) Converts the pim_ifp->ifchannel_list to a pim_ifp->ifchannel_rb 2) Removes the hashing to use the RB RB_FIND instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Rename pim_ifp->pim_ifchannel_listDonald Sharp
Remove the redundant information in pim_ifp->pim_ifchannel_list just call it pim_ifp->ifchannel_list Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Remove almost duplicate pim->ifchannel_listDonald Sharp
The pim->ifchannel_list can be duplicated by iterating over each vrf and then over each pim_ifp->pim_ifchannel_list Since list handling is taking allot of time at scale convert over to using this value. Additionally clean up pim_cmd.c to have helper functions to handle the actual encoding of data for output. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25pimd: Setup hash names appropriatelyDonald 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: Only add a igmp socket if the address is ipv4Donald Sharp
When the secondary addresses got expanded to allow v6 on the list, we needed to limit the igmp sockets to just v4 currently. Ticket: CM-16858 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-24pimd: We need to trace removal of non v4 addresses tooDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Allow pim to work in vrf's without explicitly configuring the vrf deviceDonald Sharp
Under vrf's pim needs to have a socket listening for pim packets on the vrf device so that we can actually get the packets. As such when we configure up a vrf interface, configure just enough to allow it to listen on the device and to do the right thing. 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: Bind pim kernel fd to appropriate vrfDonald Sharp
Bind the pim kernel fd to the appropriate vrf, modify the callback up into pim with the IGMP report to retrieve the incoming interface and use that to lookup the correct interface to use. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Cleanup some basic crashes from mistakes made converting to vrfDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Lookup loopback based upon vrf correctly.Donald Sharp
The vrf loopback ip address should be associated with the vrf device for vrf's, else use the loopback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Convert vif and ifindex lookups to use 'struct pim_instance *'Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Move pim_ifchannel_list and vif array into 'struct pim_instance *'Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Remove pimg from pim_iface.cDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>