summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
AgeCommit message (Collapse)Author
2022-02-17Merge pull request #10582 from anlancs/pimd-remove-redundantDonald Sharp
pimd: remove redundant code
2022-02-16pim6d: get into a kinda-working state wrt. zebraDavid Lamparter
Fix up just enough to make us not operate in complete darkness. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16pim6d: drop off IGMP codeDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-15pimd: remove redundant codeanlan_cs
`ifchannel_rb` is already cleaned by `pim_ifchannel_delete_all`, so it should be removed. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-14pim6d: IPv6-adjust iface primary/DR addrsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust neigh->source_addrDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-08Merge pull request #10292 from opensourcerouting/pim6-addr-auxDonald Sharp
pimd: start tackling IPv6 address operations
2022-01-24pimd: fix interface info memory leakIgor Ryzhov
When the interface is deleted from the system, its info must be freed. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24pimd: move iface lib initialization to a proper placeIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-17pimd: remove PIM_INADDR_IS[NOT]_ANY macrosDavid Lamparter
These really don't serve much of a purpose, especially with how inconsistently they're used. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-11pimd: Modifying members of pim_interface to accommodate IPv6 changesSai Gomathi
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>
2021-12-15Merge pull request #10215 from FRRouting/revert-10164-name_changeStephen Worley
Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"
2021-12-14Merge pull request #10167 from mobash-rasool/pim-upst-1David Lamparter
2021-12-14Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"David Lamparter
2021-12-03pimd: Modifying struct igmp_sock to gm_sock for IPv6Sai Gomathi
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>
2021-12-03pimd: Modifying name of struct igmp_join to struct gm_join to accomodate ↵Mobashshera Rasool
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>
2021-12-02pimd: Modifying members of pim_interface to accommodate IPv6 changesSai Gomathi
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>
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-25pimd: removing no caller functionsSai Gomathi
Removing the no caller function declarations and definitions in pimd directory. Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
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>
2021-10-19lib: allow to create interfaces in non-existing VRFsIgor Ryzhov
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>
2021-10-03pimd: pimd: hello sent counters are getting clear on new neighbor additionMobashshera Rasool
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>
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-27pimd: IGMP memberships are not querier specificDavid Lamparter
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>
2021-07-06pimd: fix PtP address handlingDavid Lamparter
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>
2021-07-01*: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLENDonatas Abraitis
Just drop IPV4_MAX_PREFIXLEN at all, no need keeping both. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.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-05-12pimd: There exists a path where on vrf bringup we do not create the pimregDonald Sharp
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>
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-10-22:* Convert prefix2str to %pFXDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-08-26pimd: fix IGMP receive handlingNathan Bahr
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>
2020-08-10pimd: Allow multiple secondary addresses to workDonald Sharp
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>
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-04-10Merge pull request #6027 from sarav511/vrfloopDonald Sharp
pimd: crash while finding primary address.
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-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-19pimd: crash while finding primary address.saravanank
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>
2020-03-16pimd: Do not allow to configure multicast on more than MAXVIF interfacessaravanank
RCA: When configured more than 32(MAXVIS), the inerfaces that are configured after 32nd interfaces have the value of MAXVIF. This is used as index to access the free vif tracker of array size 32(MAXVIFS). So the channel oil list pointer which is present as the next field in pim structure get corrupt, when updating free vif. This gets accessed during rpf update resulting in crash. Fix: Refrain from allocating mcast interface structure and throw config error when more than MAXVIFS are attempted to configure. Max vif checks are exempted for vrf device and pimreg as vrf device will be the first interface and not expected to fail and pimreg has reserved vif. vxlan tunnel termination device creation has this check and throw warning on max vif. All other creation are through CLI. Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-06*: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp
FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.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>
2020-02-14pimd: handle ipmr-lo operational state changesAnuradha Karuppiah
ipmr-lo is an internally added device used for multicast vxlan tunnel termination. This device is not expected to be managed by the admin however in the case it is accidentally shut we need to be able handle it by recovering when it is "no shut" again. Ticket: CM-24985 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-12-04eigrpd, ospfd, pimd: Fix assumption that interface may not be upDonald Sharp
Commit: ddbf3e60604019d4b38d51226700e2244cc531b6 This commit modified the interface up handling code in ZAPI such that the zclient handled the decoding for you. Prior to this commit ospf assumed that it could use the old ifp pointer to know state before reading the stream. This lead to a situation where ospf would `smartly` track and do the right thing in this situation. This commit changed this assumption and in certain scenarios, say a interface was changed after it was already up would lead to situations where ospf would not properly handle the new interface up. Modify ospf to track data that is important to it in it's interface->info pointer. This code pattern was followed in both eigrp and pim. In eigrp's case it was just behaving weirdly in any event so fixing this pattern is not a big deal. In pim's case it was not properly using this so it's a no-op to fix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-09*: Cleanup interface creation apisStephen Worley
Cleanup the interface creation apis to make it more clear what they are doing. Make it explicit that the creation via name/ifindex will only add it to the appropriate list. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-09-19*: Convert zapi->interface_delete to ifp callbackDonald Sharp
Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert interface_down to interface down callbackDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert from ->interface_up to the interface callbackDonald Sharp
For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Switch all zclient->interface_add to interface create callbackDonald Sharp
Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>