Commit Graph

82 Commits

Author SHA1 Message Date
Donald Sharp
5cd11e3cd0 pimd: Backing up broken state.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:15 -05:00
Donald Sharp
0490c22d20 pimd: Start handling of wrong interface for (*,G)
When we get a callback for a specific (S,G) and
we have no ifchannel for it, see if we have a
(*,G) channel and handle it appropriately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:15 -05:00
Donald Sharp
7f8b8a9af6 pimd: Remove unnecessary asserts
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-21 20:26:14 -05:00
anuradhak
3c72d65495 pim-msdp: part-2: SA cache support
This commit includes -
1. Maintaining SA cache with local and remote entries.
2. Local SA entries - there are two cases where we pick up these -
   - We are RP and got a source-register from the FHR.
   - We are RP and FHR and learnt a new directly connected source on a
     DR interface.
3. Local entries are pushed to peers immediately on addition and
   periodically. An immediate push is also done when peer session is
   established.
4. Remote SA entries - from other peers in the mesh group and passed
   peer-RPF checks.
5. Remote entries are aged out. No other way to del them
   currently. In the future we may add a knob to flush entries on
   peer-down.

Testing done -
Misc topologies with CL routers plus basic interop with another vendor (
we can process their SA updates and they ours).

Sample output -
root@rp:~# vtysh -c "show ip msdp sa"
Source                     Group               RP    Uptime
33.1.1.1               239.1.1.2            local  00:02:34
33.1.1.1               239.1.1.3            local  00:02:19
44.1.1.1               239.1.1.4        100.1.3.1  00:01:12
44.1.1.1               239.1.1.5        100.1.3.1  00:00:55
root@rp:~#

Ticket: CM-13306

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:14 -05:00
Donald Sharp
ffac1326b2 pimd: Add some explanatory debugging for a error condition.
When we decide to ignore a incoming packet, allow detailed
debugging to give a pointer to where to go to understand the
issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:13 -05:00
Donald Sharp
3a66b17b69 pimd: Abstract setting of the spt bit a bit more
Allow the spt bit to be set appropriately from multiple
places.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:13 -05:00
Donald Sharp
9244dd13db pimd: Allow FHR/RP/LHR to be one and the same
When we have a FHR/RP/LHR all on the same box, we were
experiencing a situation where we were not sending
a register stop nor where we setting the sptbit.

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

fd
2016-12-21 20:26:13 -05:00
Donald Sharp
9f0edbc93c pimd: Find an interface that is both connected and setup for pim
When we are looking up the incoming interface for the ipmr
call back socket from the kernel, look to see if the src
is connected as well as has a valid pim_ifp to use.

This is to allow vrr configuration in a mlag env.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:12 -05:00
Donald Sharp
f89022af53 pimd: Ensure 'struct nexthop' has been zeroed
When calling nexthop_lookup, the code assumes
that the nexthop passed in has been 0'ed out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:12 -05:00
Donald Sharp
02e5bd7294 pimd: Fix crash when cannot find igmp
When we look up a igmp data structure, if we
don't find it, safely do nothing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:12 -05:00
Donald Sharp
e5905a3bc3 pimd: Fix possible double free of upstream
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-21 20:26:12 -05:00
Donald Sharp
3506072736 pimd: Fix crash when igmp message comes in on non-configured interface
When we receive a igmp message through the kernel upcall, make
sure that we are configured to work on that interface via pim/igmp
before attempting to use that interface.

Ticket: CM-13338
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:12 -05:00
Daniel Walton
eaa54bdb67 pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21 20:26:11 -05:00
Daniel Walton
b05b72e80b pimd: add support for IGMPv2
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Ticket: CM-7962
2016-12-21 20:26:11 -05:00
Donald Sharp
5ce794664d pimd: Only delete on KAT when created by stream
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-21 20:26:11 -05:00
Donald Sharp
eab2a32717 pimd: Fix message size read from kernel
When we read data from the kernel allow for
larger packet sizes to be sent to us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:11 -05:00
Donald Sharp
5b668dd747 pimd: Fix LHR both a receiver and a sender
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:11 -05:00
Donald Sharp
c7b1183fc7 pimd: Don't ask for information when you are notgoing to get an answer
When we have intentionally not installed a mroute( for whatever
reason ), do not ask for information about that mroute from the
kernel when it happens.

Ticket: CM-12986
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:10 -05:00
Donald Sharp
05ca4827a6 pimd: Remove some more unprotected warnings/debugs
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-21 20:26:10 -05:00
Donald Sharp
5f0336ed02 pimd: Fixup to use new lastused
The kernel now reports lastused as the time in hz since
we last saw any packets.  So let's start tracking it
that way.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:10 -05:00
Donald Sharp
88d6652ede pimd: When sending a register stop don't need a nbr
When you send a register stop it is not necessary to
have a neighbor out the choosen interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:10 -05:00
Donald Sharp
4a40c37aa4 pimd: Further work to fix rpf lookups and nbrs
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-21 20:26:10 -05:00
Donald Sharp
63b8f7a35e pimd: Rework approach for needing nbrs
Pim sometimes needs the upstream rpf lookup to
only take into account if we have a nbr out
the selected interface or not.  Move
the code for this to a better spot so
we can make a more intelligent decision
here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:09 -05:00
Daniel Walton
dfe43e25d8 PIM: prefix-list support for selecting RP
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   CCR-5173

Ticket: CM-12819
2016-12-21 20:26:09 -05:00
Donald Sharp
a9b5987989 pimd: Start noticing where upstream state came from
We need the ability to know where upstream state
comes from and to do the right thing from there.

ticket: CM-12771
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:09 -05:00
Donald Sharp
0bf27c5c4c pimd: Switch all up->fhr to use up->flags
Allow up->flags to know if we are a FHR or not

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:09 -05:00
Donald Sharp
63c59d0c9a pimd: switch pim_rpf.h to use 'struct prefix' for address
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-21 20:26:08 -05:00
Donald Sharp
5f6f65b14c pimd: Fix creation of channel oil to happen 1st.
This has 2 fixes:

On nocache event, crate the channel oil first in
case we don't need to actually create the upstream
information

on wrvifwhole, create the channel oil and install
it, then only create the upstream information
if we are connected to the source.

Ticket: CM-12593
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:08 -05:00
Donald Sharp
3565202d74 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>
2016-12-21 20:26:07 -05:00
Donald Sharp
51e828334e 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>
2016-12-21 20:26:07 -05:00
Donald Sharp
4df01a4e66 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>
2016-12-21 20:26:07 -05:00
Donald Sharp
f24405b1e8 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
2016-12-21 20:26:07 -05:00
Donald Sharp
7fe1f66279 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>
2016-12-21 20:26:07 -05:00
Donald Sharp
4304f95c86 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>
2016-12-21 20:26:06 -05:00
Donald Sharp
6c7197b142 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>
2016-12-21 20:26:06 -05:00
Donald Sharp
8f547471df pimd: Fix typo in debug message
The debug message was wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:06 -05:00
Donald Sharp
e3be04328f 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>
2016-12-21 20:26:06 -05:00
Donald Sharp
4712642e11 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>
2016-12-21 20:26:06 -05:00
Donald Sharp
8e38a2cfcc 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>
2016-12-21 20:26:06 -05:00
Donald Sharp
f0ce50d470 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>
2016-12-21 20:26:06 -05:00
Donald Sharp
08e1fe769b pimd: Add WRVIFWHOLE callback.
Naive implementation of the WRVIFWHOLE callback
from the kernel.

signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:05 -05:00
Donald Sharp
c29a58063b 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>
2016-12-21 20:26:05 -05:00
Donald Sharp
0bc327f7b4 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>
2016-12-21 20:26:05 -05:00
Donald Sharp
872439346d pimd: Enable WrongVif and WRWHOLEVIF callbacks.
Turn on Wrong Vif and Whole packet wrong vif callbacks.

Signed-off-by: Donald Sharp <sharpd@cumuusnetworks.com>
2016-12-21 20:26:05 -05:00
Donald Sharp
4ed0af7013 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>
2016-12-21 20:26:05 -05:00
Donald Sharp
8a294fa2e4 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>
2016-12-21 20:26:04 -05:00
Donald Sharp
0365f56bd0 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>
2016-12-21 20:26:04 -05:00
Donald Sharp
630f76b6f1 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>
2016-12-21 20:26:03 -05:00
Donald Sharp
7e0cff2f98 pimd: Remove unnecessary QuaggaId
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:03 -05:00
Donald Sharp
5074a4230a pimd: more source,group conversion to prefix sg
Convert more of the code to pass around a 'struct prefix sg'
instead of individual struct addr's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:03 -05:00