summaryrefslogtreecommitdiffstats
path: root/pimd/pim_iface.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* *: Fix spelling of intefaceDonald Sharp2022-04-191-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd: remove pim_interface->optionsDavid Lamparter2022-04-081-1/+0
| | | | | | | | I should've removed this in #10960. It's a hazard in terms of forgetting to adjust PRs/other changes that might accidentally still reference the field. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: remove useless PIM_IF_* macrosDavid Lamparter2022-04-041-12/+8
| | | | | | | | | | | | 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>
* pim6d: reenable socket functionsDavid Lamparter2022-03-281-4/+0
| | | | | | pim_sock_*() functions are adapted for IPv6 now, reenable calling them. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #10366 from AbhishekNR/mld_cliDavid Lamparter2022-03-281-1/+4
|\
| * pim6d: Adding "ipv6 mld join" CLIAbhishek N R2022-03-151-1/+4
| | | | | | | | | | | | | | | | | | | | Adding the Interface level config command ipv6 mld join This command can be used to configure the static MLD join for IPv6 group addresses on the interfaces. Signed-off-by: Abhishek N R <abnr@vmware.com>
* | pimd: Add IGMP join sent/failed statisticsDonatas Abraitis2022-03-131-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` 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>
* | pim6d: reenable address management codeDavid Lamparter2022-03-121-14/+15
| | | | | | | | | | | | A few more pieces that should now work reasonably well for IPv6. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pim6d: rework interface address tracking/selectionDavid Lamparter2022-03-121-13/+82
|/ | | | | | | We only care about link-local addresses for IPv6 operation. Also, MLD needs the lowest while PIM needs the highest... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: fix unused variableDavid Lamparter2022-02-261-2/+0
| | | | | | Fix `-Werror` build. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #10400 from opensourcerouting/pim6-compilefixDonald Sharp2022-02-261-7/+45
|\ | | | | pim6d: get running with ipv6 types throughout
| * pim6d: get into a kinda-working state wrt. zebraDavid Lamparter2022-02-161-8/+29
| | | | | | | | | | | | Fix up just enough to make us not operate in complete darkness. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * pim6d: drop off IGMP codeDavid Lamparter2022-02-161-0/+16
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #10582 from anlancs/pimd-remove-redundantDonald Sharp2022-02-171-8/+0
|\ \ | |/ |/| pimd: remove redundant code
| * pimd: remove redundant codeanlan_cs2022-02-151-8/+0
| | | | | | | | | | | | | | `ifchannel_rb` is already cleaned by `pim_ifchannel_delete_all`, so it should be removed. Signed-off-by: anlan_cs <vic.lan@pica8.com>
* | pim6d: IPv6-adjust iface primary/DR addrsDavid Lamparter2022-02-141-43/+37
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pim6d: IPv6-adjust neigh->source_addrDavid Lamparter2022-02-141-15/+8
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #10292 from opensourcerouting/pim6-addr-auxDonald Sharp2022-02-081-8/+8
|\ | | | | pimd: start tackling IPv6 address operations
| * pimd: remove PIM_INADDR_IS[NOT]_ANY macrosDavid Lamparter2022-01-171-8/+8
| | | | | | | | | | | | | | These really don't serve much of a purpose, especially with how inconsistently they're used. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pimd: fix interface info memory leakIgor Ryzhov2022-01-241-0/+3
| | | | | | | | | | | | When the interface is deleted from the system, its info must be freed. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | pimd: move iface lib initialization to a proper placeIgor Ryzhov2022-01-241-4/+23
|/ | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* pimd: Modifying members of pim_interface to accommodate IPv6 changesSai Gomathi2022-01-111-33/+32
| | | | | | | | | | | Modifying the members of pim_interface which are to be used for both IPv4 and IPv6 to common names(for both MLD and IGMP). Issues: #10023 Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
* Merge pull request #10215 from FRRouting/revert-10164-name_changeStephen Worley2021-12-151-34/+36
|\ | | | | Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"
| * Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"David Lamparter2021-12-141-34/+36
| |
* | Merge pull request #10167 from mobash-rasool/pim-upst-1David Lamparter2021-12-141-13/+13
|\ \
| * | pimd: Modifying name of struct igmp_join to struct gm_join to accomodate ↵Mobashshera Rasool2021-12-031-13/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | IPv6 changes. Fix: ==== Modifying name of struct igmp_join to struct gm_join, which is to be used by both IPv4 and IPv6(for both MLD and IGMP). Co-authored-by: Abhishek N R abnr@vmware.com Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* / pimd: Modifying struct igmp_sock to gm_sock for IPv6Sai Gomathi2021-12-031-4/+4
|/ | | | | | | | | Modifying name of struct igmp_sock to struct gm_sock, which is to be used by both IPv4 and IPv6(for both MLD and IGMP). Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
* pimd: Modifying members of pim_interface to accommodate IPv6 changesSai Gomathi2021-12-031-36/+34
| | | | | | | | | | Modifying the members of pim_interface which are to be used for both IPv4 and IPv6 to common names(for both MLD and IGMP). Issue: #10023 Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
* Merge pull request #9708 from mobash-rasool/new_bDonald Sharp2021-12-021-2/+4
|\ | | | | pimd: hello sent stats counter change and new flag addition to decide hello send
| * pimd: pimd: hello sent counters are getting clear on new neighbor additionMobashshera Rasool2021-10-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Problem Statement: ================== On new neighbor addition, the tx counter for hello msg is reset. Fix: ================= Do not reset the tx counter on new neighbor addition. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
| * pimd: Add a flag to decide PIM has to send HelloMobashshera Rasool2021-10-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | pimd: removing no caller functionsSai Gomathi2021-11-261-20/+0
| | | | | | | | | | | | | | Removing the no caller function declarations and definitions in pimd directory. Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
* | *: cleanup ifp->vrf_idIgor Ryzhov2021-11-221-31/+27
| | | | | | | | | | | | | | Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | lib: allow to create interfaces in non-existing VRFsIgor Ryzhov2021-10-191-1/+2
|/ | | | | | | | | | | | | | | | | | | | | It allows FRR to read the interface config even when the necessary VRFs are not yet created and interfaces are in "wrong" VRFs. Currently, such config is rejected. For VRF-lite backend, we don't care at all about the VRF of the inactive interface. When the interface is created in the OS and becomes active, we always use its actual VRF instead of the configured one. So there's no need to reject the config. For netns backend, we may have multiple interfaces with the same name in different VRFs. So we care about the VRF of inactive interfaces. And we must allow to preconfigure the interface in a VRF even before it is moved to the corresponding netns. From now on, we allow to create multiple configs for the same interface name in different VRFs and the necessary config is applied once the OS interface is moved to the corresponding netns. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* pimd: IGMP memberships are not querier specificDavid Lamparter2021-08-271-4/+3
| | | | | | | | | | | | IGMP group/source memberships are a property of the interface; the particular IP address that the querier used to collect the data is irrelevant. ... and IGMP packets get delivered only once to pimd anyway, since we receive them on the "global" per-VRF IGMP socket. (The one in igmp_sock is only used for sending queries.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: fix PtP address handlingDavid Lamparter2021-07-061-4/+9
| | | | | | | | | | | When we have a "192.0.2.1 peer 192.0.2.2/32" address on an interface, we need to (a) recognize the local address as being on the link for our own packets, and (b) do the IGMP socket lookup with the proper local address rather than the peer prefix. Fixes: efe6f18 ("pimd: fix IGMP receive handling") Cc: Nathan Bahr <nbahr@atcorp.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLENDonatas Abraitis2021-07-011-1/+1
| | | | | | Just drop IPV4_MAX_PREFIXLEN at all, no need keeping both. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* pimd: Remove pim->vrf_id and use pim->vrf->vrf_idDonald Sharp2021-05-121-3/+3
| | | | | | | | | | | | | | | | | | | | 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: There exists a path where on vrf bringup we do not create the pimregDonald Sharp2021-05-121-0/+10
| | | | | | | | | | | When creating configuration for a vrf *Before* the vrf has been created, pim will not properly create the pimreg device and we will promptly crash when we try to pass data. Put some code checks in place to ensure that the pimreg is created for vrf's. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd: zassert => assertDavid Lamparter2021-04-231-21/+21
| | | | | | | No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Replace typo (supress => suppress)Donatas Abraitis2020-11-171-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* :* Convert prefix2str to %pFXDonatas Abraitis2020-10-221-12/+6
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* pimd: fix IGMP receive handlingNathan Bahr2020-08-261-4/+4
| | | | | | | | | | | IGMP packets received from a source that does not match the subnet of any configured addresses on the receive interface should be ignored. Also, find and use the correct IGMP socket object for the received IGMP packet. Signed-off-by: Nathan Bahr <nbahr@atcorp.com> Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
* pimd: Allow multiple secondary addresses to workDonald Sharp2020-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Suppose you have more than 2 addresses on a pim interface: lo up default 10.255.0.1/32 10.255.0.101/32 10.255.0.254/32 A `show ip pim int lo` gives us this: eva# show ip pim interface lo Interface : lo State : up Address : 10.255.0.1 (primary) 10.255.0.101/32 When we go look at the code that pulls secondary addresses in we are using a prefix_cmp to know if we know about a secondary already but were expecting true values instead of -1/0/1 being returned. Modify code so that pim sees all secondary addresses Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #6054 from sarav511/dr2ndrDonald Sharp2020-06-011-0/+1
|\ | | | | pimd: When DR becomes non DR, Still sends register packets to RP
| * pimd: When DR becomes non DR, couldreg state events not handled.saravanank2020-03-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | *: replace all random() callsRafael Zalamena2020-04-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #6027 from sarav511/vrfloopDonald Sharp2020-04-101-2/+3
|\ \ | | | | | | pimd: crash while finding primary address.
| * | pimd: crash while finding primary address.saravanank2020-03-191-2/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | RCA: Trying to get primary address for the interface. Unnumbered interface pick address from vrf device for non default. While doing so it ends up in recursion without exit condition if vrf dev doesnt have any address. Solution: Break the recursion by checking if it is vrf device. Signed-off-by: Saravanan K <saravanank@vmware.com>
* | Merge pull request #6047 from sarav511/hold0Russ White2020-03-241-1/+5
|\ \ | | | | | | pimd: Pim hello should be sent with 0 hold time on address change onold src ip