summaryrefslogtreecommitdiffstats
path: root/pimd/pim_igmp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pimd: Create a `struct pim_router` and move thread master into itDonald Sharp2019-01-041-7/+7
| | | | | | | | 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>
* *: Replace hash_cmp function return value to a boolDonald Sharp2018-10-191-3/+3
| | | | | | | | | 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-021-2/+2
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename ferr_zlog -> flog_err_sysQuentin Young2018-08-141-3/+4
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* pimd: Convert over to use LIB_ERR_XXX for zlog_errDonald Sharp2018-08-141-10/+6
| | | | | | | Convert, where appropriate, the zlog_err functions to zlog_ferr for the LIB_ERR_XXX enums Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #2608 from pacovn/PVS-Studio_dead_code_1Donald Sharp2018-07-191-2/+1
|\ | | | | eigrpd lib pimd zebra: dead code (PVS-Studio)
| * eigrpd lib pimd zebra: dead code (PVS-Studio)F. Aragon2018-07-061-2/+1
| | | | | | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* | pimd: Remove unnecessary alloc failuresDonald Sharp2018-07-081-21/+0
|/ | | | | | | Remove from pim unnecessary alloc failure testing as that alloc failure will cause an assert. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: show ip igmp statistics commandMladen Sablic2018-05-041-0/+23
| | | | | | | Command showing IGMP Rx statistics, useful for analyzing IGMP activity on interfaces. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
* pimd: mtrace only IGMP socketsMladen Sablic2018-03-081-4/+17
| | | | | | | | 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>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-2/+1
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* pimd: Multicast traceroute client and routerMladen Sablic2018-02-191-0/+11
| | | | | | | | This commit is the implementation of weak multicast traceroute. It consists of IGMP module dealing with mtrace type IGMP messages and client program mtrace/mtracebis for initiating mtrace queries. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-2/+2
| | | | | | | | | | | | | | | | | | | 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>
* pimd: add support for boundariesQuentin Young2017-09-261-12/+12
| | | | | | | | 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>
* pimd: Squash some more memory leaksDonald Sharp2017-08-021-2/+2
| | | | | | | | | | | 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>
* pimd: Setup hash names appropriatelyDonald Sharp2017-07-251-2/+5
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-902/+905
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: update hash_create(), hash_create_size()Quentin Young2017-07-021-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge remote-tracking branch 'origin/master' into pim_crash_a_booDonald Sharp2017-05-181-3/+5
|\
| * Merge branch 'stable/3.0'David Lamparter2017-05-181-3/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: ospf6d/ospf6_lsa.c ospfd/ospf_vty.c zebra/interface.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| | * pimd: IGMP Query Tx when Oth. Querier expChirag Shah2017-05-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send IGMP General Query and Get Gen. Query timer, once Other Querier timer expired. Ticket:CM-13152 Reviewed By:CCR-6189 Testing Done: tor-4# show ip igmp interface Interface State Address V Querier Query Timer Uptime swp2 up 70.1.1.2 3 other --:--:-- 00:06:45 swp3 up 80.1.1.2 3 local 00:00:35 00:22:52 Upon disabling IGMP on remote igmp interface, after other querier expiry sends a query and elects as Querier tor-4# show ip igmp interface Interface State Address V Querier Query Timer Uptime swp2 up 70.1.1.2 3 local 00:01:29 00:10:16 swp3 up 80.1.1.2 3 local 00:01:14 00:26:23 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | | pimd: Thread changes allow pim to crash a booDonald Sharp2017-05-181-10/+0
|/ / | | | | | | | | | | | | | | | | | | | | 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>
* | *: 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-10/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Cleanup unused variable writeDonald Sharp2017-03-311-3/+1
| | | | | | | | 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>
* pimd: Add hash lookup for igmp group'sDonald Sharp2017-02-241-6/+32
| | | | | | | | When we receive a group in a IGMP report let's look it up based upon a hash instead of a list. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Remove unnecessary igmp checkDonald Sharp2017-02-241-6/+0
| | | | | | | | When we receive a igmp packet, there is no need to ensure that it is a igmp packet, as that is what we have asked for. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Remove unnecessary ip header length checks on receipt.Donald Sharp2017-02-241-11/+0
| | | | | | The kernel will not hand us a malformed packet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Allow a interface in a vrf to be configured.Donald Sharp2017-02-031-6/+6
| | | | | | | 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>
* 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: With igmpv2 turned on don't accept 224.0.0.0/24 groupsDonald Sharp2016-12-221-0/+6
| | | | | | | | | | | | | | | | | | | | When a group is in the 224.0.0.0/24 range and we have igmp v2 turned on do not allow it to be considered for inclusion as a mroute. Ticket: CM-13855 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by:
* | pimd: Don't allow invalid groups to be passed for igmpDonald Sharp2016-12-221-2/+9
| | | | | | | | | | | | | | | | | | When we receive a invalid group( say outside of the 224/4 range) don't allow it to create state. Nicely reject the rejectable. Ticket: CM-13821 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Cleanup igmp read socketDonald Sharp2016-12-221-1/+54
| | | | | | | | | | | | | | | | With the change over to using the kernel upcall for igmp messages, we need to add in a read thread for the igmp socket to drain the igmp socket's receive queue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Remove unnecessary assertsDonald Sharp2016-12-221-7/+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: Fix 'ip igmp join ..'Donald Sharp2016-12-221-1/+1
| | | | | | | | | | | | | | | | | | When a static igmp join is issued, before routing has come up, the ability to recover was accidently removed from the code. Ticket: CM-13379 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Clean up the interface deletionDonald Sharp2016-12-221-0/+16
| | | | | | | | | | | | | | When cleaning up the interface, actually clean up data associated with that interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton2016-12-221-18/+18
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | pimd: add support for IGMPv2Daniel Walton2016-12-221-479/+113
| | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-7962
* | pimd: Allow igmp query to go out immediately on startupDonald Sharp2016-12-221-8/+14
| | | | | | | | | | | | | | | | When starting up allow the 1st query to go out immediately, well ok 1 second, and then the next queries to go out in query_interval/4 seconds until startup mode is finished. 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: Use XCALLOC instead of XMALLOCDonald Sharp2016-12-221-4/+4
| | | | | | | | | | | | | | Ensure that all data structures start out as 0 filled. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Fix use of 0 for NULLDonald Sharp2016-12-221-7/+7
|/ | | | | | | pimd uses allot of 0's to represent NULL. Not a good programming practice. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-08-181-4/+4
| | | | (cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
* pimd: Stale IGMP groups left behindDonald Sharp2016-07-121-5/+3
| | | | | | | | | | | | When a toin IGMPv3 join is received, the code was always auto creating the igmp group associated with the received packet. The RFC clearly states though that if a INCLUDE is received for a group with 0 sources and we have received nothing the igmpv3 packet should be ignored. Ticket: CM-11260 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: static joins no longer workedDonald Sharp2016-07-111-23/+44
| | | | | | | | | | Static joins were killed by a previous commit, which has been backed out. I've recoded the igmp join code to ignore 224.0.0.0/24 from ourselves a bit differently now. Ticket: CM-11751 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Revert "pimd: Prevent igmp packet loopback."Donald Sharp2016-07-111-13/+0
| | | | | | | | | | This reverts commit 5bbcd1f0fd82e0e982700dbc12dd959629e91b58. This commit badly breaks local 'ip igmp join XXX YYY' commands. Revert this and fix the issue a slightly different way Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>