]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agopimd: trigger on nbr up to look at rpf cache
Donald Sharp [Mon, 29 Aug 2016 14:49:47 +0000 (10:49 -0400)]
pimd: trigger on nbr up to look at rpf cache

If a neighbor comes up *after* igmp joins and *after* all
the routes are installed into the kernel, then we never
go back and fix up the rpf cache information.  So joins
never go out for those igmp joins.

Ticket: CM-12613
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix debugs to be more logical
Donald Sharp [Fri, 26 Aug 2016 18:09:41 +0000 (14:09 -0400)]
pimd: Fix debugs to be more logical

The rpf debugs really should be zebra debugs
instead of trace debugs.

Additionally fix a return 0; to return NULL;

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Further refinement of switch on a stick
Donald Sharp [Fri, 26 Aug 2016 13:40:08 +0000 (09:40 -0400)]
pimd: Further refinement of switch on a stick

The original modification to allow the RP to receive
packets on the incoming interface when it has
no outgoing interfaces was a bit aggressive and
turned all register events into a join event.

This further divides up the code to do the
right thing in each situation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Track the # of times we ask for nexthp information
Donald Sharp [Fri, 26 Aug 2016 12:38:18 +0000 (12:38 +0000)]
pimd: Track the # of times we ask for nexthp information

Keep an idea of how many times we are asking zebra
for nexthop information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove unprotected debug log
Donald Sharp [Thu, 25 Aug 2016 13:40:48 +0000 (09:40 -0400)]
pimd: Remove unprotected debug log

Upon receiving *,G joins from downstream we were outputing
a unprotected debug.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Another null pointer dereference
Donald Sharp [Wed, 24 Aug 2016 20:09:28 +0000 (16:09 -0400)]
pimd: Another null pointer dereference

When starting up with a large # of streams
it is possible to have a timing where we
do not yet have a pim_ifp.

Ticket: CM-12636
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Do not crash when attempting to install a mroute.
Donald Sharp [Wed, 24 Aug 2016 19:35:09 +0000 (15:35 -0400)]
pimd: Do not crash when attempting to install a mroute.

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>
7 years agopimd: Do not display placeholder for 'show ip pim rp-info'
Donald Sharp [Wed, 24 Aug 2016 19:32:57 +0000 (15:32 -0400)]
pimd: Do not display placeholder for 'show ip pim rp-info'

do not display the 224.0.0.0/4 rp information if none-have
been provided.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix crash in channel_oil_add_oif
Donald Sharp [Wed, 24 Aug 2016 15:23:41 +0000 (11:23 -0400)]
pimd: Fix crash in channel_oil_add_oif

Remove assert, warn user that there is a
problem and move on.

Ticket: CM-12614
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Turn on forwarding for a late added interface.
Donald Sharp [Wed, 24 Aug 2016 14:25:11 +0000 (10:25 -0400)]
pimd: Turn on forwarding for a late added interface.

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>
7 years agopimd: Fix unwrappered debug message
Donald Sharp [Wed, 24 Aug 2016 13:30:25 +0000 (09:30 -0400)]
pimd: Fix unwrappered debug message

When checking with zebra about lastused we were not
protecting a debug message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Do not send join out loopback interfaces
Donald Sharp [Wed, 24 Aug 2016 13:26:54 +0000 (09:26 -0400)]
pimd: Do not send join out loopback interfaces

When we the join timer pops for a interface
don't send the join out a loopback interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix crash with interface not configed under pim.
Donald Sharp [Wed, 24 Aug 2016 12:29:24 +0000 (08:29 -0400)]
pimd: Fix crash with interface not configed under pim.

When the RP's address in PIM is not under the loopback,
we can have a situation where this causes PIM to crash.
Check for NULL pointers.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix double close of socket.
Donald Sharp [Wed, 24 Aug 2016 12:20:38 +0000 (08:20 -0400)]
pimd: Fix double close of socket.

When a interface bounces fix the double close from happening

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add "show ip pim rp-info" command
Donald Sharp [Tue, 23 Aug 2016 20:22:14 +0000 (16:22 -0400)]
pimd: Add "show ip pim rp-info" command

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>
7 years agopimd: Fix bad state no FHR after quagga restart
Donald Sharp [Tue, 23 Aug 2016 17:39:48 +0000 (17:39 +0000)]
pimd: Fix bad state no FHR after quagga restart

If on the FHR we have an established stream between
interested parties and we stop the stream and restart
quagga we were not coming back up into the correct
state.  For the multicast stream.

Ticket: CM-12462
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix crash on RP.
Donald Sharp [Tue, 23 Aug 2016 16:25:55 +0000 (12:25 -0400)]
pimd: Fix crash on RP.

When register stop was received but the upstream
creation fails we are not handling it properly.
Note and return.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Move pim_mroute_connected_to_source to pim_iface.c
Donald Sharp [Tue, 23 Aug 2016 14:35:16 +0000 (10:35 -0400)]
pimd: Move pim_mroute_connected_to_source to pim_iface.c

Move the pim_mroute_conected_to_source function to pim_iface.c
because this is a interface question not a mroute question.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: On RP Allow no output interfaces
Donald Sharp [Mon, 22 Aug 2016 18:59:24 +0000 (14:59 -0400)]
pimd: On RP Allow no output interfaces

On the RP when we receive a register packet for the
same interface that we received the *,G join on
allow the RP to receive the packets but to do
nothing with them.

Additionally check the last_used values even
if the ioctl fails.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix pim to use correct src address for packets
Donald Sharp [Mon, 22 Aug 2016 13:10:05 +0000 (09:10 -0400)]
pimd: Fix pim to use correct src address for packets

When sending register packets to the RP from the FHR
we should be using the ip address of the incoming interface
that received the mcast packet.

Ticket: CM-12445
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix RP upstream Prune -> join state
Donald Sharp [Fri, 19 Aug 2016 19:21:45 +0000 (15:21 -0400)]
pimd: Fix RP upstream Prune -> join state

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>
7 years agopimd - Fix rpf lookup to what it was originally
Donald Sharp [Fri, 19 Aug 2016 17:25:20 +0000 (13:25 -0400)]
pimd - Fix rpf lookup to what it was originally

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

7 years agopimd: When deleting upstream double ensure route is removed
Donald Sharp [Fri, 19 Aug 2016 14:05:01 +0000 (10:05 -0400)]
pimd: When deleting upstream double ensure route is removed

Ensure that when an upstream is removed that we actually
remove the route

Also when we get a callback for whole packet before
we send a register stop make sure we are actually on the
RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix join received when in Prune or Prune Pending
Donald Sharp [Fri, 19 Aug 2016 13:07:19 +0000 (09:07 -0400)]
pimd: Fix join received when in Prune or Prune Pending

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>
7 years agopimd: Modify pim_upstream_state2str for more usage
Donald Sharp [Fri, 19 Aug 2016 11:56:59 +0000 (07:56 -0400)]
pimd: Modify pim_upstream_state2str for more usage

Just pass in the actual state to allow us to translate
the state to a string even if we don't have a upstream.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix debug to properly display state
Donald Sharp [Thu, 18 Aug 2016 18:15:33 +0000 (14:15 -0400)]
pimd: Fix debug to properly display state

We should display the state the upstream is instead of
the number of the state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Change RPF cache refresh time to 2 seconds
Donald Sharp [Thu, 18 Aug 2016 17:47:08 +0000 (13:47 -0400)]
pimd: Change RPF cache refresh time to 2 seconds

10 second delay is a bit too long.  Let's crank it down a bit
and see what happens.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow rp to configure it's keep alive timer
Donald Sharp [Thu, 18 Aug 2016 14:00:02 +0000 (10:00 -0400)]
pimd: Allow rp to configure it's keep alive timer

Allow the end user to supply a RP based keep alive
timer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: When the Keep Alive timer Pops Stop timers
Donald Sharp [Thu, 18 Aug 2016 13:44:52 +0000 (09:44 -0400)]
pimd: When the Keep Alive timer Pops Stop timers

When the Keep alive timer Pops stop the timer
and send a prune upstream if we need to
remove the state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow keep alive timer configuration
Donald Sharp [Thu, 18 Aug 2016 13:07:14 +0000 (09:07 -0400)]
pimd: Allow keep alive timer configuration

Allow the user to specify the time to wait
for a keep alive to happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix RP handling of Register message
Donald Sharp [Thu, 18 Aug 2016 00:44:51 +0000 (20:44 -0400)]
pimd: Fix RP handling of Register message

The RP needs to send the join when we want to send it

Also make sure the ka_timer is reset properly.

Ticket: CM-12473
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix register stop behavior
Donald Sharp [Wed, 17 Aug 2016 19:27:03 +0000 (19:27 +0000)]
pimd: Fix register stop behavior

Register stop was not being sent on a consistent basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add 'debug mroute detail'
Donald Sharp [Wed, 17 Aug 2016 01:13:22 +0000 (21:13 -0400)]
pimd: Add 'debug mroute detail'

When there is allot of IGMP activity for the
kernel upcall that we are ignoring, just
ignore it for the moment as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Restarting Quagga sometimes lost mroutes
Donald Sharp [Wed, 17 Aug 2016 00:08:03 +0000 (20:08 -0400)]
pimd: Restarting Quagga sometimes lost mroutes

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>
7 years agopimd: Fix typo in debug message
Donald Sharp [Tue, 16 Aug 2016 23:22:32 +0000 (19:22 -0400)]
pimd: Fix typo in debug message

The debug message was wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Use correct function to delete upstream information
Donald Sharp [Tue, 16 Aug 2016 20:19:14 +0000 (16:19 -0400)]
pimd: Use correct function to delete upstream information

When the keep alive timer finds that we are no longer
sending packets for that particular S,G, remove
the upstream information but use the function that
makes sure we check the ref count.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, pimd, zebra: Allow pimd to ask the kernel about mroute info
Donald Sharp [Thu, 11 Aug 2016 00:04:20 +0000 (00:04 +0000)]
lib, pimd, zebra: Allow pimd to ask the kernel about mroute info

When we need to lookup the mroute info for a route.  Allow
pimd to ask the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix igmp(*,G) not influencing S,G mroutes
Donald Sharp [Mon, 15 Aug 2016 11:28:36 +0000 (07:28 -0400)]
pimd: Fix igmp(*,G) not influencing S,G mroutes

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>
7 years agopimd: Set spt bit when we receive first packet on RP
Donald Sharp [Thu, 11 Aug 2016 12:08:28 +0000 (08:08 -0400)]
pimd: Set spt bit when we receive first packet on RP

When on the RP, if we receive the first correctly routed
mroute from upstream, Set the SPT bit so that the
state machine will work properly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix register stop timer
Donald Sharp [Thu, 11 Aug 2016 11:07:15 +0000 (07:07 -0400)]
pimd: Fix register stop timer

1) Ensure Timer is actually off
2) I missread the rfc, when we are in prune state, just send the
register stop.  Do not add the tunnel device yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix RP shenanigans
Donald Sharp [Wed, 10 Aug 2016 20:16:22 +0000 (16:16 -0400)]
pimd: Fix RP shenanigans

The RP was not properly handling the series of events:

1) When a WRVIFWHOLE is received if we are the RP,
send a pim register stop to the FHR.

2) When a register was received we were sending
a join (S,G) towards the S, then a immediate prune (S,G)
followed by another join (S,G).  Just send the first join

3) Save whom we received the S,G register from so we
can use it later

4) Allow a join timer to restart itself instead
of causing a crash.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fully decode mcast messages
Donald Sharp [Wed, 10 Aug 2016 12:54:58 +0000 (08:54 -0400)]
zebra: Fully decode mcast messages

Fully decode mcast messages from the kernel.  We are not
doing anything with this at the moment, but that will
change.

Additionally convert over to using lookup for
displaying the route type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Use single correct definition for prefix string buffer
vivek [Tue, 9 Aug 2016 22:54:14 +0000 (15:54 -0700)]
lib: Use single correct definition for prefix string buffer

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reivewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-12262
Reviewed By: CCR-5065
Testing Done: Manual

7 years agopimd: Properly isolate zlookup
Donald Sharp [Tue, 9 Aug 2016 19:04:23 +0000 (19:04 +0000)]
pimd: Properly isolate zlookup

The qpim_zclient_lookup was a global variable.
This is not needed.  Isolate appropriately

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove some impossible error conditions.
Donald Sharp [Tue, 9 Aug 2016 18:25:12 +0000 (14:25 -0400)]
pimd: Remove some impossible error conditions.

It is impossible that we can hit these error conditions.
Remove them from the code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Allow netlink_talk to choose the filter function to call
Donald Sharp [Tue, 9 Aug 2016 17:02:27 +0000 (13:02 -0400)]
zebra: Allow netlink_talk to choose the filter function to call

The netlink_talk call sends a message to the kernel, which
with netlink_talk_filter only waits for the ACK.

It would be nice to have the ability to specify what the handler
function would be for when we send queries about mcast S,G routes
so that we can gather the data returned from the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add WRVIFWHOLE callback.
Donald Sharp [Tue, 9 Aug 2016 16:30:26 +0000 (12:30 -0400)]
pimd: Add WRVIFWHOLE callback.

Naive implementation of the WRVIFWHOLE callback
from the kernel.

signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>

7 years agopimd: Don't pass in src_str and grp_str
Donald Sharp [Tue, 9 Aug 2016 12:05:48 +0000 (08:05 -0400)]
pimd: Don't pass in src_str and grp_str

Allow sub functions to call pim_str_sg_dump as
appropriate

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow RP to clear based upon KAT(S,G)
Donald Sharp [Mon, 8 Aug 2016 22:56:05 +0000 (18:56 -0400)]
pimd: Allow RP to clear based upon KAT(S,G)

When the KAT(S,G) pops, allow the RP to clear the
mroute.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add the display of the Keep Alive Timer for upstream
Donald Sharp [Mon, 8 Aug 2016 19:55:52 +0000 (15:55 -0400)]
pimd: Add the display of the Keep Alive Timer for upstream

Add the ability to see the Keep Alive timer for
upstream information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix another SA issue
Donald Sharp [Mon, 8 Aug 2016 14:24:02 +0000 (10:24 -0400)]
pimd: Fix another SA issue

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>
7 years agopimd: Fix some SA issues
Donald Sharp [Mon, 8 Aug 2016 13:37:51 +0000 (09:37 -0400)]
pimd: Fix some SA issues

SA found these two issues:
1) Check of ifp non-null caused other non-checks down code
to assume ifp could be null.  This is not the case.
If we get a callback at this point we must have a valid ifp pointer.

2) We were inadvertently calling igmp_source_reset_gmi with
a possible NULL source pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Some SA analysis fixes.
Donald Sharp [Fri, 5 Aug 2016 07:23:33 +0000 (03:23 -0400)]
pimd: Some SA analysis fixes.

This commit addresses some SA issues found:

1) double set variables
2) value set but never used.
3) wrong return path used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Send hello immediately with receive of new genid
Donald Sharp [Sat, 6 Aug 2016 10:26:05 +0000 (06:26 -0400)]
pimd: Send hello immediately with receive of new genid

When we receive a new genid from a neighbor, we need
to form the neigbhor relationship before the join/prune
messages are sent to the neighbor.

Additionally we were calling the
pim_upstream_rpf_genid_changed function 2 times
in a row.  This function just spun throught the upstream
list and marked all relevant upstreams to be sent
immediately

Ticket:CM-11979
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: multiple rp commands
Donald Sharp [Fri, 5 Aug 2016 17:08:06 +0000 (17:08 +0000)]
pimd: multiple rp commands

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>
7 years agopimd: Refactor RP code and start the ability to handle ranges
Donald Sharp [Fri, 5 Aug 2016 13:07:46 +0000 (09:07 -0400)]
pimd: Refactor RP code and start the ability to handle ranges

Refactor the qpim_rp into pim_rp.c so that the global data
is protected.  This will allow us to easily add the group
ranges.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix some null register issues
Donald Sharp [Thu, 4 Aug 2016 16:58:47 +0000 (12:58 -0400)]
pimd: Fix some null register issues

The Null register bit was not properly being set and
the total length was wrong as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix join_desired for (*,G) states
Donald Sharp [Thu, 4 Aug 2016 16:06:58 +0000 (12:06 -0400)]
pimd: Fix join_desired for (*,G) states

When we are evaluating if we have a inherited_olist, include
the *,G state in determing what to do.

Additionally when we receive a join or prune of *,G
do the right thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Was removing the wrong channel.
Donald Sharp [Thu, 4 Aug 2016 15:44:11 +0000 (11:44 -0400)]
pimd: Was removing the wrong channel.

When receiving a prune (*,G), we were removing
from the wrong channel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Enable WrongVif and WRWHOLEVIF callbacks.
Donald Sharp [Thu, 4 Aug 2016 15:09:30 +0000 (11:09 -0400)]
pimd: Enable WrongVif and WRWHOLEVIF callbacks.

Turn on Wrong Vif and Whole packet wrong vif callbacks.

Signed-off-by: Donald Sharp <sharpd@cumuusnetworks.com>
7 years agopimd: Fix broken build
Donald Sharp [Thu, 4 Aug 2016 00:57:47 +0000 (20:57 -0400)]
pimd: Fix broken build

I missed 2 instances of the conversion from struct prefix
to struct prefix_sg

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Remove unused variable.
Donald Sharp [Wed, 3 Aug 2016 23:53:42 +0000 (19:53 -0400)]
zebra: Remove unused variable.

Remove the rtnh variable since it is unused.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, pimd: Fix borked up prefix code
Donald Sharp [Tue, 2 Aug 2016 08:38:11 +0000 (04:38 -0400)]
lib, pimd: Fix borked up prefix code

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>
7 years agopimd: Add rs_timer display
Donald Sharp [Wed, 3 Aug 2016 18:40:10 +0000 (14:40 -0400)]
pimd: Add rs_timer display

For the 'show ip pim upstream' command addd the RSTimer to the display

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix upstream state machine.
Donald Sharp [Wed, 3 Aug 2016 15:34:38 +0000 (11:34 -0400)]
pimd: Fix upstream state machine.

RFC 4601 4.5.7:
Joined
      The downstream state machines and local membership information
      indicate that the router should join the shortest-path tree for
      this (S,G).

The code has a upstream state that is in 'J' state already
due to a S,G multicast packet received on an incoming
interface.  This packet has been forwarded to the RP.
The RP sees this and immediately sends a join towards
the S,G.

The code as originally written assumed that you could
not transition from a J state to a J state.  This is not
true.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Change packet debug to pim register specific debug
Donald Sharp [Wed, 3 Aug 2016 15:32:15 +0000 (11:32 -0400)]
pimd: Change packet debug to pim register specific debug

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add ability to debug pim Register packets
Donald Sharp [Wed, 3 Aug 2016 01:44:29 +0000 (21:44 -0400)]
pimd: Add ability to debug pim Register packets

Allow the user to specify the ability to debug
pim register packets.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove Wrong PIMREG ifchannel state
Donald Sharp [Tue, 2 Aug 2016 18:14:54 +0000 (14:14 -0400)]
pimd: Remove Wrong PIMREG ifchannel state

The PIMREG ifchannel state is an evolutionary dead-end.
I should not have introduced this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Make the NOCACHE just set the regiface to the coil
Donald Sharp [Tue, 2 Aug 2016 17:12:31 +0000 (13:12 -0400)]
pimd: Make the NOCACHE just set the regiface to the coil

When we receive a NOCACHE upcall, add the pimreg interface
to the oil so that we can receive the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Send join when a S,G is pruned
Donald Sharp [Tue, 2 Aug 2016 15:39:16 +0000 (11:39 -0400)]
pimd: Send join when a S,G is pruned

When a *,G is received, and we have S,G that is in a
non-joined state, Send the join to the S,G.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add upstream children finding
Donald Sharp [Tue, 2 Aug 2016 15:21:49 +0000 (11:21 -0400)]
pimd: Add upstream children finding

When we receive a *,g find all S,G that
are related and set pointer appropriately

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add Local Genid to 'show ip pim hello'
Donald Sharp [Tue, 2 Aug 2016 13:58:14 +0000 (09:58 -0400)]
pimd: Add Local Genid to 'show ip pim hello'

Display the local idea of what the Genid is

Ticket: CM-11980
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow the kernel to forward encap'ed packets for us
Donald Sharp [Tue, 2 Aug 2016 13:21:51 +0000 (09:21 -0400)]
pimd: Allow the kernel to forward encap'ed packets for us

When we get a pim register allow the kernel to forward the
saved packets.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: igmpv3.c was causing prune/join messages to be sent
Donald Sharp [Mon, 1 Aug 2016 17:06:35 +0000 (13:06 -0400)]
pimd: igmpv3.c was causing prune/join messages to be sent

We were erroneously sending a prune *,G immediately followed
by a join *,G under certain situations

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: change from ifchannels to oil's
Donald Sharp [Mon, 1 Aug 2016 16:29:58 +0000 (12:29 -0400)]
pimd: change from ifchannels to oil's

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: More macro fallout fix.
Donald Sharp [Mon, 1 Aug 2016 13:09:47 +0000 (09:09 -0400)]
pimd: More macro fallout fix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix pim_macro downstream_jpstate
Donald Sharp [Mon, 1 Aug 2016 12:29:00 +0000 (08:29 -0400)]
pimd: Fix pim_macro downstream_jpstate

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create storage for a raw socket.
Donald Sharp [Sat, 30 Jul 2016 01:20:19 +0000 (21:20 -0400)]
pimd: Create storage for a raw socket.

Each interface needs the ability to send raw packets
at the RP.  Create the data structure to do so.
Further commits will create the socket as necessary
and send the packet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix DownstreamJPState(S,G,I) check.
Donald Sharp [Sat, 30 Jul 2016 01:02:17 +0000 (21:02 -0400)]
pimd: Fix DownstreamJPState(S,G,I) check.

Fix the
DownStreamJPState(S,G,I) and
DownStreamJPState(*,G,I) macros.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow ifchannel S,G's to know their *,G parent
Donald Sharp [Thu, 28 Jul 2016 16:21:31 +0000 (12:21 -0400)]
pimd: Allow ifchannel S,G's to know their *,G parent

Given a S,G ifchannel, create a parent pointer for any
*,G state for that interface.  When removing a *,G
remove S,G pointers.

We need to think about the case where their is a *,G
but no S,G for a interface when we are determing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: pim_str_sg_dump can't be called 2 times in the same debug
Donald Sharp [Thu, 28 Jul 2016 07:08:03 +0000 (03:08 -0400)]
pimd: pim_str_sg_dump can't be called 2 times in the same debug

When we call pim_str_sg_dump we cannot call the variable twice
for the same debug.  This fixes this issue in the 2 places it
was borked.

Ticket: CM-12045
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix *,g pruning
Donald Sharp [Thu, 28 Jul 2016 06:46:36 +0000 (02:46 -0400)]
pimd: Fix *,g pruning

We were not properly handling the receipt of prune *,g messages.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Infrastructure to forward packet down (*,G) tree
Donald Sharp [Thu, 28 Jul 2016 02:19:08 +0000 (22:19 -0400)]
pimd: Infrastructure to forward packet down (*,G) tree

When a register is received, forward the packet as appropriate.
This is the infrastructure to make this happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create raw socket for register packets to be forwarded.
Donald Sharp [Thu, 28 Jul 2016 01:17:54 +0000 (21:17 -0400)]
pimd: Create raw socket for register packets to be forwarded.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create pim_socket_bind
Donald Sharp [Thu, 28 Jul 2016 00:13:16 +0000 (20:13 -0400)]
pimd: Create pim_socket_bind

Allow a socket to be bound to a specified
interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Revamp send of join/prune to actually set bits right.
Donald Sharp [Wed, 27 Jul 2016 20:33:41 +0000 (16:33 -0400)]
pimd: Revamp send of join/prune to actually set bits right.

When a *,G report is sent, the RPT and WC bits
are set as well as the source is the RP address
for the group.

If this routers idea of the RP for this group is
different than the idea of the RP from the sender
than that particular *,G can be dropped.

Ticket: CM-12031
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Start abstraction for WC and RPT bits
Donald Sharp [Wed, 27 Jul 2016 19:27:52 +0000 (15:27 -0400)]
pimd: Start abstraction for WC and RPT bits

Start the abstraction of the WC and RPT bits
so we can send the data as appropriate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fixup pim_oil interface to be a bit more consistent.
Donald Sharp [Wed, 27 Jul 2016 19:39:28 +0000 (15:39 -0400)]
pimd: Fixup pim_oil interface to be a bit more consistent.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Find the parent on newly created upstream's
Donald Sharp [Sun, 24 Jul 2016 05:15:09 +0000 (01:15 -0400)]
pimd:  Find the parent on newly created upstream's

When we create a new upstream data structure find the parent.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Make kernel upcalls PIM_DEBUG_MROUTE
Donald Sharp [Sat, 23 Jul 2016 23:54:51 +0000 (19:54 -0400)]
pimd: Make kernel upcalls PIM_DEBUG_MROUTE

The kernel upcalls for control messages should
be PIM_DEBUG_MROUTE instead of PIM_DEBUG_PIM_TRACE

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix Join/Prune logging
Donald Sharp [Sat, 23 Jul 2016 23:18:19 +0000 (19:18 -0400)]
pimd: Fix Join/Prune logging

For some reason Join/Prune debugs were being
turned on by trace not by the 'debug pim packets join'
command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add some 'show debug pim' output
Donald Sharp [Wed, 27 Jul 2016 01:00:09 +0000 (21:00 -0400)]
pimd: Add some 'show debug pim' output

Add some missing 'show debug pim' output so that I can
see what I think I'm debugging.

In general the pim debugs need another round of fixing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Some bug fixes for the register receive code path
Donald Sharp [Sat, 23 Jul 2016 16:30:41 +0000 (12:30 -0400)]
pimd: Some bug fixes for the register receive code path

When we receive a register receive handle it a bit
better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow (*,G) joins to join a (s,g) that pre-exists
Donald Sharp [Sat, 23 Jul 2016 10:01:55 +0000 (06:01 -0400)]
pimd: Allow (*,G) joins to join a (s,g) that pre-exists

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add code to handle the inheritance for (s,g)
Donald Sharp [Sat, 23 Jul 2016 09:36:44 +0000 (05:36 -0400)]
pimd: Add code to handle the inheritance for (s,g)

Add code to handle the inheritance and to send the
join upstream as appropriate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove unnecessary QuaggaId
Donald Sharp [Sat, 23 Jul 2016 08:12:05 +0000 (04:12 -0400)]
pimd: Remove unnecessary QuaggaId

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: start fix of inherited_olist
Donald Sharp [Sat, 23 Jul 2016 07:47:15 +0000 (03:47 -0400)]
pimd: start fix of inherited_olist

We were not correctly determing the inherited olist and
applying it to the s,g.

Start the work to do this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Stop leaving pim_register_recv early
Donald Sharp [Sat, 23 Jul 2016 07:36:25 +0000 (03:36 -0400)]
pimd: Stop leaving pim_register_recv early

When we received a pim_register_recv we were shortcutting
the algorithm to determine what to do when we receive
a register pim message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix _find and switch_to_spt_desired.
Donald Sharp [Sat, 23 Jul 2016 07:33:53 +0000 (03:33 -0400)]
pimd: Fix _find and switch_to_spt_desired.

The pim_upstream_find function should not be finding a *,G
Find what is asked of it.

The switch_to_spt_desired should return true on the RP currently.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: pim_br switch to struct prefix
Donald Sharp [Sat, 23 Jul 2016 04:35:35 +0000 (00:35 -0400)]
pimd: pim_br switch to struct prefix

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>