summaryrefslogtreecommitdiff
path: root/pimd/pim_join.c
AgeCommit message (Collapse)Author
2022-07-06pimd: Handle rpf_addr in join/prune processingsarita patra
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12pimd: Disable receiving join/prune on passive interfacesarita patra
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12pimd: Handling Join/Prune statistics for passive interfacesarita patra
Increment pim_ifstat_prune_send only when interface is passive disabled. 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-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-12pim6d: encode PIM joins correctlyDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28pimd: Handle pim join/prune recv flow for ipv6Mobashshera Rasool
Making the code changes to handle both ipv4 and ipv6 in the same code Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-14pim6d: IPv6-adjust jp_agg->groupDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust pim_upstream addrDavid 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-14pim6d: IPv6-adjust various pim_sgaddr usesDavid Lamparter
Since `pim_sgaddr` is `pim_addr` now, that causes a whole lot of fallout anywhere S,G pairs are handled. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: more TLV parse/encode IPv6 preparationDavid Lamparter
More proliferation of pim_addr to work towards IPV6. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: prepare IPv6 address encoding functionsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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-17pimd: fix `%pI4` that needs to be `%pPA`David Lamparter
There's only 2 locations of this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: replace pim_inet4_dump with `%pPAs`David Lamparter
Only pim_sgaddr uses are covered by this since regular in_addr is still used for singular addresses, so only a part of pim_inet4_dump calls are gone with this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: add PIMADDR_ANY & tackle assignmentsDavid Lamparter
Need a separate constant that is IPv6 when needed. Also assign the whole struct rather than just s_addr. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: move, rename and deploy pim_addr_is_any()David Lamparter
Replaces comparison against INADDR_ANY, so we can do IPv6 too. (Renamed from "pim_is_addr_any" for "pim_addr_*" naming pattern, and type fixed to bool.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: remove pim_str_sg_dump()David Lamparter
... and replace with `%pSG` printfrr specifier. This actually used a static buffer in the formatting function, so subsequent formatting would overwrite earlier uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: `prefix_sg` => `pim_sgaddr`David Lamparter
Mostly just 2 sed calls: - `sed -e 's%struct prefix_sg%pim_sgaddr%g'` - `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'` Plus a bunch of fixing whatever that broke. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: move `%pSG4` to `%pPSG4`David Lamparter
Since this is only used in very few places, moving it out of the way is reasonable. (`%pSG` will be pim_sgaddr) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-05pimd: remove usage of inet_ntopDonald Sharp
We should not be using inet_ntop. and should be using the appropriate %pI4 instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-26pimd: modifications in PIM joinsSai Gomathi
Problem : ======= (*,G) created on transit node where same groups are defined as SSM At present FRR has SSM checks for IGMP report, but SSM check is missing for PIM join. Fix : === When an interface receives the PIM (*,G)join with G as SSM group, then PIMd supposed to discard that join. There is no need to maintain PIM state for this group. Signed-off-by: Sai Gomathi <nsaigomathi@vmware.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-02pimd: (*,G) Prune processing doesn't remove SGRpt ifchannelvdhingra
problem : ========= When (*,G) prune received where we have SGRpt state, ifchannel goes to NO_INFO state and doesn't get removed. Root cause : ============ During the processing of (*,G) prune, we are not removing the ifchannel on PruneTmp or PrunePendingTmp state. Fix : ===== In that scenario, stop joinExpiry timer and delete the ifchannel. issue #7347 Co-authored-by: Saravanan K <saravanank@vmware.com> Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-10-14Merge pull request #5895 from patrasar/2404618Donald Sharp
pimd: Clear (s,g,rpt) ifchannel on (*, G) prune received
2020-06-04pimd: Clear (s,g,rpt) ifchannel on (*, G) prune receivedSarita Patra
Issue: After SPT switchover, do shut and no-shut the received connected interface, traffic stops. R2 | | + + Client-----R1--------R3----Source R2 is RP. Root cause: Client is sending join for G and Source is sending traffic for G. Before SPT switchover, traffic flows R3-R2-R1, after SPT switchover, traffic flows R3-R1. Now Check in R2, there will be 2 ifchannel gets created. first is (*, G) ifchannel which gets created because of (*, G) join received from R1, second is (S, G) ifchannel which gets created because of (s,g,rpt) prune received from R1 Shut the receiver connected interface on R1, R1 will send a (*, G) prune towards RP (R2). On receiving (*, G) prune, R2 deletes the (*, G) ifchannel. (s,g) ifchannel with flag (s,g,rpt) set will be timeout after the prune timer expires. Before this timer expires, do noshut the received connected inrterface on R1. R1 will send a (*,G) join to R2(RP), So oil will be updated in (*, G), but wont get updated in (s,g) since the flag (s,g,rpt) is set. So traffic flow stops. Fix: When (*, G) ifchannel is getting deleted because of (*, G) prune received, as (*,G) prune indicates that the router no longer wishes to receive shared tree traffic, so clear (S,G,RPT) flag on all the child (S,G) ifchannel, which was created because of (S,G,RPT) prune received Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-17pimd: (*, G) Prune should be processed even if the RP in packet is not RP(G)saravanank
RCA: We are ignoring (*,G) prune when the RP in packet is not RP(G) Fix: According to RFC 4601 Section 4.5.2: Received Prune(*,G) messages are processed even if the RP in the message does not match RP(G). We have allowed starg prune to be processed in the scenario. 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>
2019-12-06Merge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixesJafar Al-Gharaibeh
PIM state machine fixes
2019-11-19pimd: Various buffer overflow reads and crashesDonald Sharp
A variety of buffer overflow reads and crashes that could occur if you fed bad info into pim. 1) When type is setup incorrectly we were printing the first 8 bytes of the pim_parse_addr_source, but the min encoding length is 4 bytes. As such we will read beyond end of buffer. 2) The RP(pim, grp) macro can return a NULL value Do not automatically assume that we can deref the data. 3) BSM parsing was not properly sanitizing data input from wire and we could enter into situations where we would read beyond the end of the buffer. Prevent this from happening, we are probably left in a bad way. 4) The received bit length cannot be greater than 32 bits, refuse to allow it to happen. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-15pimd: OIF add with PROTO_PIM is not happening if join rxed in PP stateAnuradha Karuppiah
Dumps while in problem state - ============================ [from "show ip pim state"] Active Source Group RPT IIF OIL 1 6.0.0.31 239.1.1.111 n swp1 swp4( J * ) [from "show ip pim join"] Interface Address Source Group State Uptime Expire Prune swp3 6.0.0.22 6.0.0.31 239.1.1.111 JOIN --:--:-- 03:11 --:-- You can see from the dumps that the pim downstream router has joined on swp3 but that OIF has not been added to the OIL with flag PIM_OIF_FLAG_PROTO_PIM. This is because the join was rxed while the ifchannel was in a prune-pending state. Relevant logs - =============== [ PIM: recv_prune: prune (S,G)=(6.0.0.31,239.1.1.111) rpt=1 wc=0 upstream=6.0.0.22 holdtime=210 from 6.0.0.28 on swp3 PIM: pim_upstream_ref(pim_ifchannel_add): upstream (6.0.0.31,239.1.1.111) ref count 3 increment PIM: pim_upstream_add(pim_ifchannel_add): (6.0.0.31,239.1.1.111), iif 6.0.0.26/0 (swp1) found: 1: ref_count: 3 PIM: pim_ifchannel_add: ifchannel (6.0.0.31,239.1.1.111) is created PIM: pim_joinprune_recv: SGRpt flag is set, del inherit oif from up (6.0.0.31,239.1.1.111) PIM: pim_mroute_add(pim_channel_del_oif), vrf default Added Route: (6.0.0.31,239.1.1.111) IIF: swp1, OIFS: swp4 PIM: pim_channel_del_oif(pim_joinprune_recv): (S,G)=(6.0.0.31,239.1.1.111): proto_mask=4 IIF:1 OIF=swp3 vif_index=3 PIM: recv_join: join (S,G)=(6.0.0.31,239.1.1.111) rpt=0 wc=0 upstream=6.0.0.22 holdtime=210 from 6.0.0.28 on swp3 PIM: PIM_IFCHANNEL(swp3): (6.0.0.31,239.1.1.111) is switching from SGRpt(PP) to JOIN PIM: Sending Request for New Channel Oil Information(6.0.0.31,239.1.1.111) VIIF 1(default) ] Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: re-eval JD on sources when a STAR_OIF is removedAnuradha Karuppiah
When a inherited OIL becomes empty join-desired can go to false. So we need to re-run join-desired evaluation on any inherited OIL changes. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: update add_oif and del_oif debugs to print callerAnuradha Karuppiah
These logs were printing file name which has little value (is always pim_oil.c). Instead print the caller. add_oif/del_oif are being called directly from one too many. Instead OIF setup needs to be consolidated via the PIM state machine. These debugs are expected to help in understanding what needs to be cleaned up. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-12pimd: `debug igmp trace` turns on non igmp debugsDonald Sharp
When you turn on `debug igmp trace` we are seeing a bunch of debugs associated with pim processing. This is because we were using PIM_DEBUG_TRACE which is both `debug igmp trace` and `debug pim trace` when tracing igmp code it would be nice to only see igmp work. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-08pimd: Fix zlog_warn when we mean debug and vice versaDonald Sharp
There are several places in the pim where we are mixing up zlog_warn w/ zlog_debug and vice versa. If we are protecting a zlog_warn w/ a debug is it really a warn? If we have an actual error situation we should also warn about it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-14pimd: PIM Msg header includes N bit as defined by RFCsaravanank
This commit includes parsing of Nbit and contructing pim hdr with Nbit Adding Nbit to PIm hdr structure Adding Scope zone bit and Bidir bit to Encoded IPv4 Group Address Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-02-24pimd: Handling Null incoming interface of dummy upstreamSarita Patra
When FRR receives IGMP/PIM (*, G) join and RP is not configured or not reachable, then we are creating a dummy upstream with incoming interface as NULL and upstream address as INADDR_ANY. Added upstream address and incoming interface validation where it is necessary, before doing any operation on the upstream. Signed-off-by: Sarita Patra <saritap@vmware.com>
2017-09-26pimd: add support for boundariesQuentin Young
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>
2017-08-26*: fix compiler warningsDavid Lamparter
Specifically, gcc 4.2.1 on OpenBSD 6.0 warns about these; they're bogus (gcc 4.2, being rather old, isn't quite as "intelligent" as newer versions; the newer ones apply more logic and less warnings.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-24pimd: Cleanup S,GRPt prune handling on Mroute LossDonald Sharp
1) Clean up display of S,GRPt prune state to be more meaningful 2) Upon receipt of a S,GRPt prune make sure we transition to the correct state 3) Upon loss of a S,GRPt prune make sure we transition to the correct state as well as immediately send a *,G join upstream to propagate the loss of the prune. 4) Removal of a weird S,G state being installed upon loss of a S,G RPt prune. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-03pimd: Lookup S,G ifchannel after we create itDonald Sharp
There are situations where we receive a *,G with a S,G,RPT Prune embedded where we do not actually have any S,G yet(MSDP with multiple RP's with the same address). As such since we only need to lookup the S,G ifchannel once, do it after the recv_prune. Ticket: CM-17230 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Cleanup some join debug messagesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: pim_rp.c -> convert pimg to pimDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-06Merge branch 'stable/3.0'David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18pimd: Fix to Tx S,G Join when SGRpt->Join stateChirag Shah
-Upon Rx (*,G) Join w/o SGRpt at RP, trigger (S,G) Join towards FHR, unset SGRpt flag from channel, add (*,G) oif to (S,G) entry. -Add I am not RP check to triger SGRpt on *,G path otherwise, send S,G Prune on SPT path from RP to FHR upon receving *,G Prune. -Upon Rx SGRpt receive, remove OIF(downstream where Prune received) from specific S,G. Testing Done: pim-smoke Ran 95 tests in 11790.552s FAILED (SKIP=10, failures=4) Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
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>
2017-05-09Merge pull request #435 from chiragshah6/pim_devJafar Al-Gharaibeh
pimd: Introduce show command for protocol counters