summaryrefslogtreecommitdiff
path: root/pimd/pim_pim.c
AgeCommit message (Collapse)Author
2024-09-09pimd: refactor pim_sock_read to be used with unicast bsr msgsJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09pimd: candidate BSR/RP show commands, move under ip pim bsrJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09pimd: Candidate-BSR supportJafar Al-Gharaibeh
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-06-20pimd: allow sending packets without pinned ifaceDavid Lamparter
The upcoming Candidate-RP code needs to send PIM packets that go through normal unicast routing, without forcing a specific output interface. Allow passing in NULL ifp to do that. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-08-30pimd: When receiving a packet be more careful with length in pim_pim_packetDonald Sharp
a) If the length passed is the header length then it is possible that assignment of data will happen without data actually existing. b) Just move the assignment to after we ensure that the pim packet received is the minimum possible length that can be received. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
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>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-24pimd,pim6d: Modify pim_neighbor_find() APISarita Patra
Modify pim_neighbor_find() API to find the neighbor in neighbor secondary list. Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-06-13pim6d: Removal of IPV6_HDRINCL optionBalaji Gurudoss
1. Removal of IPV6_HDRINCL option 2. Removal of IPv6 headers in TX 3. Addition of IPV6_PKTINFO and setting of source ipv6 address for TX. Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
2022-05-12pimd: Handling hello send statistics for passive interfacesarita patra
Increment pim_ifstat_hello_sent only when interface is passive disabled. Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12pimd: Disable sending of control packets on passive interfacesarita patra
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-06pimd: un-dependency-hell `pim_instance.h`David Lamparter
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>
2022-04-04pimd: remove useless PIM_IF_* macrosDavid Lamparter
The only function these macros have is to make the code confusing. "PIM_IF_DO_PIM" sounds like it triggers some action, but it doesn't. Replace with "bool" fields in struct pim_interface. (Note: PIM_IF_*_IGMP_LISTEN_ALLROUTERS was always set, without any way to unset it. It is completely removed now and always enabled.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28pim6d: box out IPv4 fragmentation codeDavid Lamparter
... this shouldn't run for IPv6. (We'll switch to not using IPV6_HDRINCL later, so the kernel will handle it, but for the time being let's just stop trying to use the IPv4 code for IPv6.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28pim6d: include IPv6 pseudoheader in RX checksumsDavid Lamparter
A lot simpler than the TX code. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28pim6d: include IPv6 pseudoheader in TX checksumsDavid Lamparter
Lots of passing src/dst around, but it is what it is. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28pim6d: send PIM packetsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-25pim6d: IPv6 headers are always stripped on receiveDavid Lamparter
IPV6_HDRINCL is a TX-only option (unlike IP_HDRINCL), so on RX there never are IPv6 headers to be looked at / skipped over. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-25pim6d: Adjust pim_pkt_dst_addr_ok for PIMv6Mobashshera Rasool
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25pimd: Modify pim_pim_packet api for receiving v6 packetsMobashshera Rasool
Modified the pim_pim_packet api for pimv4/v6. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25pim6d: Parse BSM packet for PIMv6Mobashshera Rasool
Modify pim_bsm_process to accomodate v4 and v6 address for parsing the received packet. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-15pimd: Add additional IGMP stats (peak number of groups)Donatas Abraitis
``` exit1-debian-11# sh ip igmp statistics interface eth2 IGMP statistics Interface : eth2 V1 query : 0 V2 query : 0 V3 query : 25 V2 leave : 0 V1 report : 0 V2 report : 0 V3 report : 34 mtrace response : 0 mtrace request : 0 unsupported : 0 joins failed : 0 joins sent : 13 general queries sent : 2 group queries sent : 24 peak groups : 9 total groups : 4 total source groups : 1 exit1-debian-11# sh ip igmp statistics interface eth2 json { "eth2":{ "name":"eth2", "queryV1":0, "queryV2":0, "queryV3":25, "leaveV2":0, "reportV1":0, "reportV2":0, "reportV3":34, "mtraceResponse":0, "mtraceRequest":0, "unsupported":0, "peakGroups":9, "totalGroups":4, "totalSourceGroups":1, "joinsFailed":0, "joinsSent":13, "generalQueriesSent":2, "groupQueriesSent":24 } } ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-14Merge pull request #10786 from opensourcerouting/pim6-pim-prepDonald Sharp
pim6d: prepare for sending & receiving actual PIM packets
2022-03-13pimd: Add IGMP join sent/failed statisticsDonatas Abraitis
``` exit1-debian-11# sh ip igmp statistics IGMP statistics Interface : global V1 query : 0 V2 query : 0 V3 query : 0 V2 leave : 0 V1 report : 0 V2 report : 0 V3 report : 16 mtrace response : 0 mtrace request : 0 unsupported : 0 joins failed : 0 joins sent : 11 total groups : 4 total source groups : 0 exit1-debian-11# sh ip igmp statistics json { "global":{ "name":"global", "queryV1":0, "queryV2":0, "queryV3":0, "leaveV3":0, "reportV1":0, "reportV2":0, "reportV3":16, "mtraceResponse":0, "mtraceRequest":0, "unsupported":0, "totalGroups":4, "totalSourceGroups":0, "joinsFailed":0, "joinsSent":11 } } ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-12pimd: log interface name for send errorsDavid Lamparter
Not very helpful to be told only the fd number. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12pim6d: pim6d socket changesBalaji Gurudoss
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>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
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>
2022-02-14pim6d: IPv6-adjust pim_msg_send() and relatedDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-10pimd: Modifying in_addr to pim_addr in struct pim_interface for IPv6Mobashshera Rasool
Based on compiler option, pim_addr will be changed to in_addr or in6_addr for pimd and pim6d respectively. Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-12-02Merge pull request #9708 from mobash-rasool/new_bDonald Sharp
pimd: hello sent stats counter change and new flag addition to decide hello send
2021-11-16*: unify if_is_loopback/if_is_loopback_or_vrfIgor Ryzhov
We should always treat the VRF interface as a loopback. Currently, this is not the case, because in some old pre-VRF code we use if_is_loopback instead of if_is_loopback_or_vrf. To avoid any future problems, the proposal is to rename if_is_loopback_or_vrf to if_is_loopback and use it everywhere. if_is_loopback is renamed to if_is_loopback_exact in case it's ever needed, but currently it's not used anywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-04pimd: Do not explicitly set the thread pointer to NULLDonatas Abraitis
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-03pimd: Add a flag to decide PIM has to send HelloMobashshera Rasool
Problem Statement: ================== pim maintains two counters hello tx and hello rx at interface level. At present pim needs to send the hello message prior to other pim message as per RFC. This logic is getting derived from the tx hello counters. So when a new neighbor is added, tx counters are set to zero and then based on this, it is further decided to send hello in pim_hello_require function. Fix: ==== Separating the hello statistics and the logic to decide when to send hello based on a new flag. pim_ifstat_hello_sent will be used to note down the hello stats while a new flag is added to decide whether to send hello or not if it is the first packet to a neighbor. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-08-24pimd: Fixing coverity issuesSai Gomathi
Problem ====== In pim_msg_send_frame api, the while loop was executed only once. Fix === while is changed to if, as in the code flow the while part is getting executed only once. Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-08-24pimd: Fixing coverity issuesSai Gomathi
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-05-12pimd: Remove pim->vrf_id and use pim->vrf->vrf_idDonald Sharp
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>
2021-04-23pimd: zassert => assertDavid Lamparter
No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-11-17*: Replace typo (supress => suppress)Donatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-01Merge pull request #6054 from sarav511/dr2ndrDonald Sharp
pimd: When DR becomes non DR, Still sends register packets to RP
2020-04-17*: replace all random() callsRafael Zalamena
Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-03-24Merge pull request #6047 from sarav511/hold0Russ White
pimd: Pim hello should be sent with 0 hold time on address change onold src ip
2020-03-23pimd: Add check for pim join, hello and assert to drop pkts without ↵saravanank
all-pim-routers dest. This is as per RFC. This is identified when conformance suite catched join. RCA: Packets were processed without checking allowed dest IP for that packet. Fix: Added check for dest IP Converted this check to a function Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-19pimd: When DR becomes non DR, couldreg state events not handled.saravanank
RCA: Upstreams which are in register state other than noinfo, doesnt remove register tunnel from oif after it becomes nonDR Fix: scan upstreams with iif as the old dr and check if couldReg becomes false. If couldreg becomes false from true, remove regiface and stop reg timer. Do not disturb the entry. Later the entry shall be removed by kat expiry. Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-19pimd: Pim hello should be sent with 0 hold time on address change on old src ipsaravanank
RCA: This was todo item in current code base Fix: Hello sent with 0 hold time before we update the pim ifp primary address Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>