summaryrefslogtreecommitdiffstats
path: root/pimd/pim_join.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pimd: (*, G) Prune should be processed even if the RP in packet is not RP(G)saravanank2020-03-171-10/+11
| | | | | | | | | | | | 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>
* *: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp2020-03-061-14/+10
| | | | | | FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis2020-03-051-20/+20
| | | | | | Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixesJafar Al-Gharaibeh2019-12-071-3/+2
|\ | | | | PIM state machine fixes
| * pimd: OIF add with PROTO_PIM is not happening if join rxed in PP stateAnuradha Karuppiah2019-11-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * pimd: re-eval JD on sources when a STAR_OIF is removedAnuradha Karuppiah2019-11-151-2/+1
| | | | | | | | | | | | | | 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>
| * pimd: update add_oif and del_oif debugs to print callerAnuradha Karuppiah2019-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* | pimd: Various buffer overflow reads and crashesDonald Sharp2019-11-201-0/+11
|/ | | | | | | | | | | | | | | | | | | | | | | 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>
* pimd: `debug igmp trace` turns on non igmp debugsDonald Sharp2019-11-121-1/+1
| | | | | | | | | 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>
* pimd: Fix zlog_warn when we mean debug and vice versaDonald Sharp2019-10-081-17/+10
| | | | | | | | | 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>
* pimd: PIM Msg header includes N bit as defined by RFCsaravanank2019-05-151-3/+3
| | | | | | | | 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>
* pimd: Handling Null incoming interface of dummy upstreamSarita Patra2019-02-251-3/+3
| | | | | | | | | | | 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>
* pimd: add support for boundariesQuentin Young2017-09-261-1/+17
| | | | | | | | 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>
* *: fix compiler warningsDavid Lamparter2017-08-261-1/+1
| | | | | | | | 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>
* pimd: Cleanup S,GRPt prune handling on Mroute LossDonald Sharp2017-08-241-7/+2
| | | | | | | | | | | | | 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>
* pimd: Lookup S,G ifchannel after we create itDonald Sharp2017-08-041-2/+8
| | | | | | | | | | | | 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>
* pimd: Cleanup some join debug messagesDonald Sharp2017-07-241-4/+16
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: pim_rp.c -> convert pimg to pimDonald Sharp2017-07-241-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-457/+461
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'stable/3.0'David Lamparter2017-06-061-8/+31
|\ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * pimd: Fix to Tx S,G Join when SGRpt->Join stateChirag Shah2017-05-181-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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>
* | *: 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>
* | Merge pull request #435 from chiragshah6/pim_devJafar Al-Gharaibeh2017-05-091-0/+17
|\ \ | |/ |/| pimd: Introduce show command for protocol counters
| * pimd: Introduce show command for protocol countersChirag Shah2017-05-021-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For all pim enabled interfaces and single pim enable interface command. Clear command to clear protocol counters stats. 'show ip pim interface traffic {WORD} {json}' 'clear ip pim interface traffic' Testing Done: bringup Pim configuration and form RPT and SPT and check show ip pim interface traffic command output, perform clear form of interface traffic command and verified all counters reset via show form of command. tor-21# show ip pim interface traffic swp2 Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx --------------------------------------------------------------------------------------------------------------- swp2 22/22 0/10 0/0 0/0 0/0 0/0 leaf-22# show ip pim interface traffic swp3 Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx --------------------------------------------------------------------------------------------------------------- swp3 23/22 10/0 0/0 0/0 0/0 0/0 spine-1#show ip pim interface traffic Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx --------------------------------------------------------------------------------------------------------------- br1 0/1 0/0 0/0 0/0 0/0 0/0 lo 0/0 0/0 0/0 0/0 0/0 0/0 swp1 0/1 0/0 0/0 0/0 0/0 0/0 swp2 0/1 0/0 0/0 0/0 0/0 0/0 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | pimd: Fix WG/SGRpt & WG J/P processingChirag Shah2017-05-071-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During processing of Join/Prune, for a S,G entry, current state is SGRpt, when only *,G is received, need to clear SGRpt and add/inherit the *,G OIF to S,G so it can forward traffic to downstream where *,G is received. Upon receiving SGRpt prune remove the inherited *,G OIF. From, downstream router received *,G Prune along with SGRpt prune. Avoid sending *,G and SGRpt Prune together. Reset upstream_del reset ifchannel to NULL. Testing Done: Run failed smoke test of sending data packets, trigger SPT switchover, *,G path received SGRpt later data traffic stopped S,G ages out from LHR, sends only *,G join to upstream, verified S,G entry inherit the OIF. Upon receiving SGRpt deletes inherited oif and retains in SGRpt state. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | pimd: fix pimd crashes around pim rpfChirag Shah2017-04-251-1/+7
| | | | | | | | | | | | | | | | During neighbor down event, all upstream entries rpf lookup may result into nhop address with 0.0.0.0 and rpf interface info being NULL. Put preventin check where rpf interface info is accessed. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | pimd: Fix WG/SGRpt & WG J/P processingChirag Shah2017-04-251-2/+2
|/ | | | | | | | | | | | | | | | During processing of Join/Prune, for a S,G entry, current state is SGRpt, when only *,G is received, need to clear SGRpt and add/inherit the *,G OIF to S,G so it can forward traffic to downstream where *,G is received. Upon receiving SGRpt prune remove the inherited *,G OIF. Testing Done: Trigger SPT switchover, *,G path received SGRpt later data traffic stopped S,G ages out from LHR, sends only *,G join to upstream, verified S,G entry inherit the OIF. Upon receiving SGRpt deletes inherited oif and retains in SGRpt state. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* pimd: Optimize group size figuring out.Donald Sharp2017-03-231-1/+1
| | | | | | | We were figuring out the group size 2 times. Figure it out 1 time and then pass it around. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Remove unneeded debug statementDonald Sharp2017-03-171-1/+0
| | | | | | Left over debug statement that is not needed anymore Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Join/Prune AggregationDonald Sharp2017-03-021-39/+194
| | | | | | | | Add the ability for PIM to send Join/Prunes as an aggregated message instead of individual messages for each S,G. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* pimd: Refactor pim_joinprune_sendDonald Sharp2017-02-241-20/+16
| | | | | | Refactor pim_joinprune_send to use 'struct rpf' Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Fix PIM DBG messageChirag Shah2017-02-141-8/+9
| | | | | | | | | | Ticket: CM-13771 Reviewed By: CCR-5537 Testing Done: yes Fix to CM-13771 where DBG message was out of order. Signed-off-by: Chirag Shah <chirag@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: Fix where we handle the inherited_olist for ifchannelDonald Sharp2016-12-221-67/+0
| | | | | | | | | | | | | | | | | | When we receive a new *,G ifchannel, handle the inherited_olist for S,G mroutes in a place where it is more appropriate. Ticket: CM-13892 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
* | pimd: Remove redundant loggingDonald Sharp2016-12-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When receiving a JOIN/PRUNE message if we have trace turned on we output this: 2016/11/28 17:11:46.368827 PIM: pim_socket_recvfromto: HAVE_IP_PKTINFO to=224.0.0.13,103 2016/11/28 17:11:46.368956 PIM: Recv PIM JOINPRUNE packet from 169.254.0.6 to 224.0.0.13 on swp31s1: ttl=255 pim_version=2 pim_msg_size=34 checksum=e623 2016/11/28 17:11:46.369003 PIM: pim_joinprune_recv: from 169.254.0.6 on swp31s1 2016/11/28 17:11:46.369053 PIM: recv_prune: prune (S,G)=(20.0.11.253,229.1.2.3) rpt=0 wc=0 upstream=169.254.0.5 holdtime=210 from 169.254.0.6 on swp31s1 2016/11/28 17:11:46.369099 PIM: nonlocal_upstream: recv prune (S,G)=(20.0.11.253,229.1.2.3) to local upstream=169.254.0.5 on swp31s1 Clean up the messaging to this: 2016/11/28 17:11:46.368956 PIM: Recv PIM JOINPRUNE packet from 169.254.0.6 to 224.0.0.13 on swp31s1: ttl=255 pim_version=2 pim_msg_size=34 checksum=e623 2016/11/28 17:11:46.369053 PIM: recv_prune: prune (S,G)=(20.0.11.253,229.1.2.3) rpt=0 wc=0 upstream=169.254.0.5 holdtime=210 from 169.254.0.6 on swp31s1 Ticket: CM-13752 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
* | pimd: Allow storing of sg in string formatDonald Sharp2016-12-221-13/+6
| | | | | | | | | | | | | | | | 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: Add code to handle pim prune(S,G) with sptbitDonald Sharp2016-12-221-3/+2
| | | | | | | | | | | | | | Add some more code to handle the prune(S,G) with the sptbit set. Turns this ifchannel into a (S,G,rpt). Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Add Handler for Receive (*,G) join for (S,G,rpt)Donald Sharp2016-12-221-1/+11
| | | | | | | | | | | | | | | | | | According to Figure 5( Downstream per-interface (S,G,rpt) state when we receive a (*,G) we need to move (S,G,rpt) children of the (*,G) into different states. This implements that. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Ensure 'struct prefix sg' is inited in right orderDonald Sharp2016-12-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | When we called pim_parse_addr_group, don't reinitialize the 'struct prefix_sg' *after* we've parsed the group. Ensure in other places that we do this work, we initialize prior as well. Ticket: CM-13510 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: use 'struct prefix_sg' for recv_join and _pruneDonald Sharp2016-12-221-36/+20
| | | | | | | | | | | | | | | | When we read in the S,G from the join/prune message, convert it into a 'struct prefix_sg' at an earlier point in time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Modify pim_parse_addr_source to use 'struct prefix_sg'Donald Sharp2016-12-221-5/+4
| | | | | | | | | | | | | | Modify the pim_parse_addr_source function to take a 'struct prefix_sg' and to fill in the src data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Modify pim_parse_addr_group to use 'struct prefix_sg'Donald Sharp2016-12-221-7/+7
| | | | | | | | | | | | | | | | Modify the pim_parse_addr_group to use 'struct prefix_sg sg'. This is the first of 2 commits to clean up this parsing to be a bit better. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: pim upstream child listDonald Sharp2016-12-221-45/+39
| | | | | | | | | | | | | | Add the ability to keep the list of S,G's associated with a *,G. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Pass in upstream to pim_msg_join_prune_encode.Donald Sharp2016-12-221-4/+3
| | | | | | | | | | | | | | | | Pass in the upstream data structure to pim_msg_join_prune_encode so it can decide to send (S,G,rpt) information if it wants to or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | pimd: Convert pim_joinprune_send to receive upstreamDonald Sharp2016-12-221-4/+4
| | | | | | | | | | | | | | | | When sending a join/prune send in the upstream pointer. this will allow us to implement some of the other state machines necessary. 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: Add hash lookups for upstreamDonald Sharp2016-12-221-2/+2
| |
* | pimd: Fix crash when looking at S,G from *,GDonald Sharp2016-12-221-0/+2
| | | | | | | | | | | | | | | | | | When looping over S,G's associated with a *,G, there can exist situations where we have not created the channel oil for the S,G yet. Don't allow this to crash the system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>