summaryrefslogtreecommitdiffstats
path: root/pimd/pim_ssmpingd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pimd: remove redundant closing socketanlan_cs2023-09-231-1/+0
| | | | | | | The socket has been closed in `ssmpingd_setsockopt()` in the wrong cases, so remove the redundant closing socket from outer layer. Signed-off-by: anlan_cs <anlan_cs@tom.com>
* *: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp2023-03-241-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-241-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Rename `struct thread` to `struct event`Donald Sharp2023-03-241-1/+1
| | | | | | | | | Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-14/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: un-dependency-hell `pim_instance.h`David Lamparter2022-05-061-0/+1
| | | | | | | 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>
* pim6d: Addition of ipv6 ssmpingd config commandsBalaji Gurudoss2022-04-121-4/+2
| | | | Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
* pim6d: fix format string mistakes in ssmpingdDavid Lamparter2022-03-251-5/+5
| | | | | | PR #10653 forgot to update a bunch of format specifiers. Fix. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: Changes done in pim_ssmpingd to support v6Balaji Gurudoss2022-03-161-129/+113
| | | | Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
* pim6d: pim6d socket changesBalaji Gurudoss2022-03-121-34/+16
| | | | | | | | socket changes to support IPv6 PIM Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com> [DL: cleaned up & refactored a whole bunch more.] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Change thread->func to return void instead of intDonald Sharp2022-02-241-5/+2
| | | | | | | 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>
* pimd: Remove pim->vrf_id and use pim->vrf->vrf_idDonald Sharp2021-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | VRF creation can happen from either cli or from knowledged about the vrf learned from zebra. In the case where we learn about the vrf from the cli, the vrf id is UNKNOWN. Upon actual creation of the vrf, lib/vrf.c touches up the vrf_id and calls pim_vrf_enable to turn it on properly. At this point in time we have a pim->vrf_id of UNKNOWN and the vrf->vrf_id of the right value. There is no point in duplicating this data. So just remove all pim->vrf_id and use the vrf->vrf_id instead since we keep a copy of the pim->vrf pointer. This will remove some crashes where we expect the pim->vrf_id to be usable and it's not. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd: zassert => assertDavid Lamparter2021-04-231-3/+3
| | | | | | | No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis2020-03-051-37/+30
| | | | | | Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* pimd: Create a `struct pim_router` and move thread master into itDonald Sharp2019-01-041-1/+1
| | | | | | | | 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>
* *: list_delete_and_null() -> list_delete()David Lamparter2018-10-021-1/+1
| | | | 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/+3
| | | | 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-3/+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>
* pimd: Remove unnecessary alloc failuresDonald Sharp2018-07-081-15/+0
| | | | | | | Remove from pim unnecessary alloc failure testing as that alloc failure will cause an assert. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-4/+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: Squash some more memory leaksDonald Sharp2017-08-021-1/+1
| | | | | | | | | | | 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: Make pim_ssmpingd.c 'struct pim_instance' awareDonald Sharp2017-07-241-25/+27
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Cleanup use of VRF_DEFAULT to pimg->vrf_idDonald Sharp2017-07-241-1/+1
| | | | | | | Use the appropriate vrf_id instead of always defaulting to VRF_DEFAULT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-332/+353
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: Address PR CommentsDonald Sharp2017-05-181-3/+0
| | | | | | Remove a bit more dead code and unused variable. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Thread changes allow pim to crash a booDonald Sharp2017-05-181-4/+1
| | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* *: Remove non-vrf based ifindex lookupDonald Sharp2017-03-151-1/+2
| | | | 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: Allow storing of sg in string formatDonald Sharp2016-12-221-2/+1
| | | | | | | | | | | | | | | | 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>
* | pimd: Remove unnecessary assertsDonald Sharp2016-12-221-3/+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: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton2016-12-221-16/+16
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@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-2/+2
| | | | | | | | | | | | | | Ensure that all data structures start out as 0 filled. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Fixup some dead codeDonald Sharp2016-12-221-4/+2
|/ | | | | | Remove some dead code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: create a helper function to set the IP_MULTICAST_LOOP sockoptionRenato Westphal2016-11-251-11/+7
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* pimd/zebra: fix setting of IP_MULTICAST_LOOP on OpenBSDRenato Westphal2016-11-251-1/+1
| | | | | | | | | Linux, FreeBSD and NetBSD (and possibly others too) accept both uint8_t and int for the IP_MULTICAST_LOOP sockoption. OpenBSD, in the other hand, accepts only uint8_t. To make setting IP_MULTICAST_LOOP work on every supported platform, always pass a uint8_t variable as a parameter. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-08-181-1/+1
| | | | (cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
* pimd: use IPPROTO_IP (not SOL_IP) for IP_PKTINFODavid Lamparter2016-05-261-2/+2
| | | | | | | Solaris uses the same socket API for IP_PKTINFO as Linux, but doesn't have a SOL_IP define. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: cast to sockaddr_in to sockaddrDavid Lamparter2016-05-261-2/+3
| | | | | | | While glibc seems to have something in the system headers that prevents this from triggering a warning, FreeBSD doesn't. Fix the warning. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: merge pimd as of 2015-01-19David Lamparter2016-05-261-0/+448
Welcome pimd to the Quagga daemon zoo! This is a merge of commit 77ae369 ("pimd: Log ifindex found for an interface when zebra lib reports a new connected address."), with the intermediate "reconnect" changes removed (c9adf00...d274381). d274381 is replaced with b162ab7, which includes some changes. In addition, 4 reconnect-related changes and 1 cosmetic one have been bumped out. The rebase command used to produce the branch that is merged here is: git rebase --onto b162ab7 c9adf00 77ae369 Note that 3 patches had their author rewritten from "Anonymous SR#108542 <>" (which is not a valid git author ID) to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address listed in the associated Savannah ticket) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>