summaryrefslogtreecommitdiff
path: root/pimd/pim_ifchannel.c
AgeCommit message (Collapse)Author
2017-04-05pimd: Add the ability to never SPT switchoverDonald Sharp
Add the ability to allow pim to determine if we should allow spt-switchover or not on the LHR. Signed-off-by: Donald Sharp
2017-04-05pimd: Allow SPT switchoverDonald Sharp
This allows SPT switchover for S,G upon receipt of packets on the LHR. 1) When we create a *,G from a IGMP Group Report, install the *,G route with the pimreg device on the OIL. 2) When a packet hits the LHR that matches the *,G, we will get a WHOLEPKT callback from the kernel and if we cannot find the S,G, that means we have matched it on the LHR via the *,G mroute. Create the S,G start the KAT and run inherited_olist. 3) When the S,G times out, safely remove the S,G via the KAT expiry 4) When the *,G is removed, remove any S,G associated with it via the LHR flag. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30Merge branch 'master' into pim-ssmDonald Sharp
2017-03-23pimd: Update inherited_olist when receiving a pruneDonald Sharp
We were not always updating the inherited_olist when we received a prune. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-23pimd: Allow SSM groups to co-exist with ASM groups.anuradhak
SSM groups (232/8 or user configured SSM range) can exist in the same multicast network as ASM groups. For such groups all RPT related state machine operations have to be skipped as defined by section 4.8 of RFC4601 - 1. Source registration is skipped for SSM groups. For SSM groups mroute is setup on the FHR when a new multicast flow is rxed; however source registration (i.e. pimreg join) is skipped. This will let the ASIC black hole the traffic till a valid OIL is added to the mroute. 2. (*,G) IGMP registrations are ignored for SSM groups. Sample output: ============= fhr# sh ip pim group-type SSM group range : 232.0.0.0/8 fhr# sh ip pim group-type 232.1.1.1 Group type: SSM fhr# sh ip pim group-type 239.1.1.1 Group type: ASM fhr# Sample config: ============= fhr(config)# ip pim ssm prefix-list ssm-ranges fhr(config)# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-15344 Testing Done: 1. SSM/ASM source-registration/igmp-joins. 2. On the fly multicast group type changes. 3. pim-smoke.
2017-03-17pimd: Add display of SGRpt state for ifchannelDonald Sharp
When we get a SGrpt Prune embedded in the *,G Join, Display the created ifchannel as being SGRpt state. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-02pimd: Join/Prune AggregationDonald Sharp
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>
2017-02-24pimd: Refactor pim_joinprune_sendDonald Sharp
Refactor pim_joinprune_send to use 'struct rpf' Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-24pimd: Make ifchannel lookup a hash lookupDonald Sharp
When we are at scale, it is possible that we have a very large number of ifchannels per interface. So make lookup for that situation to be a hash lookup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-24pimd: Narrow inheritance search down to interface we are interested in.Donald Sharp
When we are only looking at one ifchannel, for inheritance, narrow the search down to only the interface/ifchannel we are interested in Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-24pimd: Only debug in the unusual caseDonald Sharp
When receiving a J/P packet, only check to see if we should log when the J/P packet is not for us. Very slight performance improvement additionally Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-24pimd: Remove unneeded parameterDonald Sharp
pim_upstream_join_timer_decrease_to_t_override passed in a `struct in_addr` that in all cases was part of the upstream data structure that was passed in already. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30pimd: Fix handling of *,G on RP to allow prune of S,G to go outDonald Sharp
When on the RP we received a prune *,G for an established S,G If join_desired is no longer true we need to prune and reset some timers, in addition to removing the inherited interface from the olist. This was not happening because we were just removing the inherited oif from the *,G. Ticket: CM-14561 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30pimd: Cleanup uninitialized memory accessDonald Sharp
Valgrind noticed that we have a read of uninitialized memory: Conditional jump or move depends on uninitialised value(s) ==13749== at 0x428067: pim_ifassert_winner_set (pim_assert.c:57) ==13749== by 0x4266F0: pim_ifchannel_add (pim_ifchannel.c:535) ==13749== by 0x426CC1: pim_ifchannel_join_add (pim_ifchannel.c:730) ==13749== by 0x427B5B: recv_join (pim_join.c:95) ==13749== by 0x427B5B: pim_joinprune_recv (pim_join.c:270) ==13749== by 0x42354F: pim_pim_packet (pim_pim.c:249) ==13749== by 0x4236C0: pim_sock_read (pim_pim.c:349) ==13749== by 0x4E60587: thread_call (thread.c:1462) ==13749== by 0x40C75E: main (pim_main.c:266) ==13749== This commit fixes that issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30pimd: Use correct flag to add an oifDonald Sharp
When we are creating the igmp ifchannel we were creating it with both a P and a I flag. This was causing it to not be cleaned up properly when the interface was shut down. Subsuquently when the interface came back up we would attempt to add it back in but it would fail. Ticket: CM-14586 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30pimd: Fixup tracking of where we got OIF's from.Donald Sharp
This commit does these three things: 1) Add code to 'show ip pim state' to show where OIF's got their decision to include that interface 2) Add code in pim_mroute_[add|del] to display what we think we are adding to the kernel 3) Add code to properly track where we got the incoming request from and to appropriately not remove a OIL if we have state still Ticket: CM-14034 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-01-17Merge remote-tracking branch 'origin/master' into pim_lib_work2Donald Sharp
2016-12-21pimd: Allow bridges and bonds to up and downDonald Sharp
Bridges and bonds when ifdowned are removed from the kernel in it's entirety, while pim assumed that interfaces were kept around in some fashion. Basically when we had an ifdown event, for all ifchannels on that interface delete from the OIF. Also note the fact that the vif has gone away and we need to recreate it on the next ifup. Ticket: CM-13896 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix where we handle the inherited_olist for ifchannelDonald Sharp
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>
2016-12-21pimd: Modify the Prune Pending Timer Pop to not assertDonald Sharp
So there exist conditions where we can start the Prune Pending Timer and receive other packets that cause us to not stop the pending timer. This was due to a missread of the state machine. Additionally when the prune pending timer pops and we are not in prune pending state, note the fact and move on with our life instead of crashing and burning Ticket: CM-13851 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by:
2016-12-21pimd: Remove redundant loggingDonald Sharp
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>
2016-12-21pimd: Allow storing of sg in string formatDonald Sharp
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>
2016-12-21pimd: Add code to handle pim prune(S,G) with sptbitDonald Sharp
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>
2016-12-21pimd: Fix possible crash when leaving a channelDonald Sharp
When leaving a channel, there exists a possibility that we have not created the channel oil yet. Ensure that we have channel oil before dereferencing Ticket: CM-13522 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Remove unnecessary assertsDonald Sharp
When we handle the thread arguments, there is no need to assert. As that if they are wrong, we are going down shortly anyways. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add Handler for Receive (*,G) join for (S,G,rpt)Donald Sharp
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>
2016-12-21pimd: Don't delete ifchannel if expiry timer is still running.Donald Sharp
Don't delete the ifchannel if the expiry timer is still running. We might need to add the prune pending timer as well? Not sure Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add ability for ifchannel *,G to know their S,G'sDonald Sharp
Add the ability for pim ifchannels *,G's to know their corresponding S,G's. This will facilitate handling S,G,rpt state information better. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Store ifchannel information in a global list too.Donald Sharp
This fix handles two issues: 1) Searching entire vrf_iflist to get per interface pim_ifchannel_list 2) Display of ifchannel information in pim not being ordered correctly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: pim upstream child listDonald Sharp
Add the ability to keep the list of S,G's associated with a *,G. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix gcc compile issue.Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Convert pim_joinprune_send to receive upstreamDonald Sharp
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>
2016-12-21pimd: Ignore (S,G) Prunes with no current stateDonald Sharp
If we get a (S,G) Prune with no current ifchannel state, ignore the neighbors request. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Start (S,G,rpt) codingDonald Sharp
Start putting some infrastructure for (S,G,rpt) handling Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Clean up the interface deletionDonald Sharp
When cleaning up the interface, actually clean up data associated with that interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix possible double free of upstreamDonald Sharp
Fix possible double free of upstream and in addition add some debug code to help find where the problem is coming from. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix child ifchannel overwrite parent ifchannelDonald Sharp
When we look for child channels, don't overwrite the parents ifchannel. Leave that one alone. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add interface to ifchannel debugsDonald Sharp
When outputting data about ifchannels due to debug include the interface this is happening on. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix ifchannel being left aroundDonald Sharp
In some situations, the deletion of the ifchannel would not ocurr if the last flag cleared was the assert flag. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21pimd: Add hash lookups for upstreamDonald Sharp
2016-12-21pimd: Only delete on KAT when created by streamDonald Sharp
When we have pim_mroute.c or pim_register.c create the upstream state, only delete it then when the KAT timer expires, else we will not have the refcount right and we will do bad things. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix LHR both a receiver and a senderDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: sort pim_ifchannel_listDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Further work to fix rpf lookups and nbrsDonald Sharp
When we do a RPF lookup return a path that we have neighbors for in those cases where we need to have a neighbor to pass along the SG state via a pim join/prune message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: switch pim_rpf.h to use 'struct prefix' for addressDonald Sharp
mrib_nexthop_addr and rpf_addr should be 'struct prefix' so that we can safely handle unnumbered data from a nexthop lookup in zebra Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Turn on forwarding for a late added interface.Donald Sharp
If we receive a join for a upstream interface that hasn't yet been added to pim for working under it, we never go back and add the forwarding on when we get the interface added to pim. Ticket: CM-11800 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix join received when in Prune or Prune PendingDonald Sharp
When we are a FHR, and the upstream state is in Prune or Prune Pending allow the join because we know we want to forward traffic to the RP. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix igmp(*,G) not influencing S,G mroutesDonald Sharp
When we receive a (*,G) route decide if we need to cause any output interfaces to be added to any S,G route associated. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21lib, pimd: Fix borked up prefix codeDonald Sharp
Fix the struct prefix to be an actual struct prefix_sg. This cleans up a bunch of code to make it look nicer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>