summaryrefslogtreecommitdiff
path: root/pimd/pim_zebra.c
AgeCommit message (Collapse)Author
2017-03-30pimd: Receive incoming v6 addresses and place in pim_ifp listDonald Sharp
Add code to properly receive v6 addresses up from zebra and to properly place them into our interface secondary address list. Additionally cleanup some code in pim_cmd.c that was broken by these changes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-23pimd: del_oif and pim_channel_del_oif are the same functionDonald Sharp
These two functions do the exact same thing. Refactor Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-23pimd: When deleting last intf from an OIL don't delete the mrouteDonald Sharp
In certain conditions when we are deleting the interface from an OIL do not delete the mroute. That decision should be made by the state machine. 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-21Merge pull request #280 from donaldsharp/more_pimJafar Al-Gharaibeh
More pim
2017-03-16pimd: Fix connected data structure not being freedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-16pimd: When the RPF is changed remove the groupDonald Sharp
When changing the RPF cleanup the old entry in the J/P Agg neighbor list. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-16pimd: Nexthop tracking supportChirag Shah
Add pim Nexthop tracking feature 1st part where, specific RP or Source address (unicast address) register with Zebra. Once nexthop update received from Zebra for a given address, scan RP or upstream entries impacted by the change in nexthop. Reviewed By: CCR-5761, Donald Sharp <sharpd@cumulusnetworks.com> Testing Done: Tested with multiple RPs and multiple *,G entries at LHR. Add new Nexthop or remove one of the link towards RP and verify RP and upstream nexthop update. similar test done at RP with multiple S,G entries to reach source. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-03-15*: Refactor ifindex2ifname to be VRF awareDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-08*: add frr_config_fork()David Lamparter
Centralise read_config/daemonize/dryrun/pidfile/vty_serv into libfrr. This also makes multi-instance pid/config handling available as part of the library. It's only wired up in ospfd, but the code is in lib/. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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: Refactor pim_rpf_update to take a 'struct pim_rpf'Donald Sharp
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: Move qpim_zclient_update -> zclientDonald Sharp
Rename the qpim_zclient_update variable to zclient. This is to follow the naming conventions in the rest of the code. Additionally move the struct zclient * pointer into pim_zebra.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30pimd: Start abstraction of zclient data structure for pim_zebra.cDonald Sharp
Start the abstraction of the zclient data structure out from a global variable for the entire program to a global variable to the pim_zebra.c file. Signed-off-by: Donald Sharp <sharpd@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: Tell ourselves to rescan when we discover an issueDonald Sharp
When we have network churn and we have an inherited_olist notice when we may have a situation where we need to recalculate the inherited_olist. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Clarify pim_mroute_[add|del] function debuggingDonald Sharp
When debugging is turned on for 'debug mroute' we are unable to tell when a mroute has been added or deleted from the mrib. Notice when we do it and who called it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Do not allow deletion of output interface.Donald Sharp
There exists conditions where PIM will have it's upstream route removed and an unreachable route is installed that points out the downstream interface. This unreachable route is removed from bgp as soon as it's path selection algorithim works properly, but pim has already deleted the oif and never puts it back in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add more RP rescan pointsDonald Sharp
When we add in or delete ip addresses from an interface we may need to rescan the rp's that we know of to make sure that they are still available. Ticket: CM-12623 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2016-12-21pim-nexthop: mroute and pim-upstream rpf are falling out of sync.anuradhak
Currently the mroute-IIF and upstream RPF-IIF/neigh are resolved separately. This must change i.e. be merged together for a couple of reasons - 1. In the case of ECMP we will use a load-share mechanism (based on G or SG) to pick an RPF neighbor in 3.2.1 (to use the load-sharing cap of anycast-RP). Using a different resolution mechanism for mroute-IIF will simply not work. 2. In a non-CLOS topology it is actually possible to have routers that do not participate in PIM. In this case the tree will be set up using different routers than the ones chosen for the mroute IIF. And traffic will not be forwarded. This change is however too big for 3.2.0. So to handle CM-13714 I have simply forced rpf update on neigh add which fixes the specific problem seen on link flap in a clos (it is not very efficient but traffic recovers). In problem state - (jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# ip mr (0.0.0.0, 225.1.1.1) Iif: lo Oifs: swp3 lo (20.0.11.253, 225.1.1.1) Iif: swp1 Oifs: swp3 (jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# vtysh -c "show ip pim upstream" Iif Source Group State Uptime JoinTimer RSTimer KATimer RefCnt lo * 225.1.1.1 Joined 00:08:44 00:00:15 --:--:-- --:--:-- 1 swp2 20.0.11.253 225.1.1.1 Joined 00:08:35 00:00:56 --:--:-- 00:02:59 1 (jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-anycast-rp: Add limited support for secondary addresses.anuradhak
Anycast requires that the lo interface be associated with multiple addresses. One is the anycast IP address (which is the same on all RPs participating in RP redundancy) and the second is the unique IP address that will be used as the router id by routing protocols. To accomodate that we maintain a list of secondary addresses per-pim iface and allow any of them to be the RP address. This lets the I_am_RP macro succeed on anycast RPs. Note that the support is limited i.e. we don't actually advertise a secondary list to the neighbors. This is assuming the anycast IP will never be used as a router id i.e. will never be an RPF neighbor. Sample output: ============== dell-s6000-04# sh ip pim interface lo Interface : lo State : up Address : 100.1.1.1 (primary) 100.1.1.2 100.1.1.3 100.1.2.1 >>>>>>> SNIP >>>>>>>>>>>>>>> dell-s6000-04# sh ip pim interface lo json { "lo":{ "name":"lo", "state":"up", "address":"100.1.1.1", "index":1, "lanDelayEnabled":true, "secondaryAddressList":[ "100.1.1.2", "100.1.1.3", "100.1.2.1" ], >>>>>>> SNIP >>>>>>>>>>>>>>> dell-s6000-04#sh ip pim rp-info RP address group/prefix-list OIF I am RP 100.1.2.1 224.0.0.0/4 lo yes dell-s6000-04# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@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: 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: Protect some zlog_debug messagesDonald Sharp
Protect some zlog_debug messages with if(...) so we don't see them all the time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21PIM After LHR swp bounce toward rx host, igmp_source_forward_startDaniel Walton
failure message repeats in log Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-13340
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: Add basic nexthop lookup cached information.Donald Sharp
Cache the last time we looked up the nexthop for this particular address. Store time to usec accuracy. 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: Allow mroute to return if incoming interface comes backDonald Sharp
If the incoming interface comes back, reinstall the channel oil if the mroute is not installed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Create channel_oil hash for quicker lookupDonald Sharp
When looking up the channel_oil use a hash to find it. Keep the list around for quick walks of the channel oils. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add hash lookups for upstreamDonald Sharp
2016-12-21pimd: Remove some more unprotected warnings/debugsDonald Sharp
Pim is outputting a bunch of unprotected debugs. In a system with a high # of events even with no logging we will receive lots of messages. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Use MULTIPATH_NUM for maxpathsDonald Sharp
When looking up nexthops for a address, just use the MULTIPATH_NUM as the number allowed to receive instead of an arbitrary limit of 20 paths. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21PIM: prefix-list support for selecting RPDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: CCR-5173 Ticket: CM-12819
2016-12-21pimd: Vif is not created in some startup conditionsDonald Sharp
When rebooting a switch, if under unnumbered config there exists a situation where some interfaces may not create the vif in the kernel. Ticket: CM-12830 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Allow ip address selection for BGP unnumberedDonald Sharp
When a interface is configured as BGP unnumbered, it has a v6 LL address as well as no v4 addresses. In this case let's look at the lo's ip address as the primary address to use. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> rebase
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: Do not crash when attempting to install a mroute.Donald Sharp
When installing a mroute on rpf change make sure that we have oil for it at this time. Ticket: CM-12636 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add "show ip pim rp-info" commandDonald Sharp
List the RP information we have configured. Fix bug where we were not properly initializing some code Ticket: CM-12617 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix RP upstream Prune -> join stateDonald Sharp
This fix allows the RP to transition from a Prune'd to Join state on reception of proper control messages. Additionally it was noticed on if down -> if up transitions the prune then join message was going out the wrong interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd - Fix rpf lookup to what it was originallyDonald Sharp
I tried to be smart and skirt around rpf lookup if I knew the incoming interface. This turns out to be not necessarily a good thing because we can easily have asymetrical routing. This fix removes the attempt to cache the ifp we received the incoming packet on and just lets the lookup work like it should. Additionally it removes the weird hardcoding of the rpf interface from the register stuff. Ticket: CM-12530 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> reb
2016-12-21pimd: Restarting Quagga sometimes lost mroutesDonald Sharp
When on a intermediate switch between the FHR and RP when Quagga is restarted. Pimd is coming up so fast and getting the S,G join before networking is properly working on the switch. We would never install the mroute in this case. What was happening is that the scan of the S,G was occurring and we were figuring out who we should talk to but we were never installing the route for it. Notice that we've never installed the route and install it if the mroute has changed. Ticket: CM-12460 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Properly isolate zlookupDonald Sharp
The qpim_zclient_lookup was a global variable. This is not needed. Isolate appropriately Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix another SA issueDonald Sharp
pim_zebra.c was checking to see if a ifp pointer was null in some debug statements. This caused the SA code to assume that if we were at this point then the ifp could be null and subsuquent code that doesn't check for it to be wrong. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: multiple rp commandsDonald Sharp
Allow the user to specify multiple rp commands. 'ip pim rp A.B.C.D' -> translates to 'ip pim rp A.G.C.D 224.0.0.0/24' ip pim rp A.B.C.D A.B.C.D/M First is the rp, second is the group with mask. Groups and masks cannot be over each other except 224.0.0.0/24 which is the fallback if used. Ticket: CM-7860 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix broken buildDonald Sharp
I missed 2 instances of the conversion from struct prefix to struct prefix_sg 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>