]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agopimd: Add some helper functions.
Donald Sharp [Wed, 2 Nov 2016 15:20:27 +0000 (11:20 -0400)]
pimd: Add some helper functions.

Currently these are stubs to help debug logic.
Will be filled in as we go.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add the ability to test if the RPF' is the same
Donald Sharp [Wed, 2 Nov 2016 14:53:28 +0000 (10:53 -0400)]
pimd: Add the ability to test if the RPF' is the same

Test the ability to see if two RPF' are the same
or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoPIM After LHR swp bounce toward rx host, igmp_source_forward_start
Daniel Walton [Wed, 2 Nov 2016 18:03:00 +0000 (18:03 +0000)]
PIM After LHR swp bounce toward rx host, igmp_source_forward_start
failure message repeats in log

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-13340

7 years agopimd: Add ability to listen to igmp messages on 224.0.0.2
Donald Sharp [Wed, 2 Nov 2016 13:35:31 +0000 (09:35 -0400)]
pimd: Add ability to listen to igmp messages on 224.0.0.2

Some igmpv2 messages are sent to 224.0.0.2.  We were
not listening for these messages and as such we
were ignoring some withdrawals.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix 'ip igmp join ..'
Donald Sharp [Tue, 1 Nov 2016 14:16:03 +0000 (10:16 -0400)]
pimd: Fix 'ip igmp join ..'

When a static igmp join is issued, before routing
has come up, the ability to recover was accidently
removed from the code.

Ticket: CM-13379
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: When nexthop lookup fails, back out gracefully
Donald Sharp [Tue, 1 Nov 2016 03:17:53 +0000 (23:17 -0400)]
pimd: When nexthop lookup fails, back out gracefully

When the nexthop lookup fails when establishing the
upstream state as part of a register receive, kill
the upstream state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow FHR/RP/LHR to be one and the same
Donald Sharp [Tue, 1 Nov 2016 00:49:18 +0000 (20:49 -0400)]
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

7 years agopimd: Modify Debug to be better
Donald Sharp [Tue, 1 Nov 2016 00:01:16 +0000 (20:01 -0400)]
pimd: Modify Debug to be better

Make debugs of some pim processes easier
to interpret and understand.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Be more careful looking up mroute statistics
Donald Sharp [Mon, 31 Oct 2016 20:33:38 +0000 (16:33 -0400)]
pimd: Be more careful looking up mroute statistics

When we get a request to look up the mroute statistics
from the kernel, ensure that the interface returned
is a valid usable interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: pim upstream child list
Donald Sharp [Mon, 24 Oct 2016 02:47:25 +0000 (22:47 -0400)]
pimd: pim upstream child list

Add the ability to keep the list of S,G's associated with
a *,G.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopim-msdp: part-1 - initial protocol infra.
anuradhak [Tue, 25 Oct 2016 17:59:48 +0000 (10:59 -0700)]
pim-msdp: part-1 - initial protocol infra.

This commit includes the following changes -
1. Support for MSDP peer DB (hash and sorted list).
2. Support for the following timers - keepalive, connect-retry, hold.
3. TCP session management (lower-ip is active, higher-ip is passive).
4. MSDP KA packet rx/tx.
5. Limited temporary config (will be replaced with the more automation
friendly RP-set).

Testing done -
Peer bringup/deletion (including interop with another vendor)

Sample out -
root@dell-s6000-04:~# sudo vtysh -c "show ip msdp peer"
Peer                       Local        Mesh-group        State Uptime
100.1.1.1              100.1.2.1           default  established 00:07:27
100.1.3.1              100.1.2.1           default  established 00:31:50
root@dell-s6000-04:~#

Coming soon -
1. part-2: SA cache management.
2. part-3: SPT setup using source in SA cache.
3. part-4: CLI cleanup.

Ticket: CM-13306

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix gcc compile issue.
Donald Sharp [Mon, 31 Oct 2016 13:20:01 +0000 (09:20 -0400)]
pimd: Fix gcc compile issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Pass in upstream to pim_msg_join_prune_encode.
Donald Sharp [Mon, 31 Oct 2016 13:03:57 +0000 (09:03 -0400)]
pimd: Pass in upstream to pim_msg_join_prune_encode.

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>
7 years agopimd: Remove unused/unmaintained test commands
Donald Sharp [Mon, 31 Oct 2016 12:54:35 +0000 (08:54 -0400)]
pimd: Remove unused/unmaintained test commands

The test commands are not being maintained and
are not out of date with the rest of the system.  There
are better ways to test code and in addition these
commands if entered by a user could seriously impact
their running system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Convert pim_joinprune_send to receive upstream
Donald Sharp [Mon, 31 Oct 2016 12:44:01 +0000 (08:44 -0400)]
pimd: Convert pim_joinprune_send to receive upstream

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>
7 years agopimd: When nexthop_lookup fails allow a retry.
Donald Sharp [Sun, 30 Oct 2016 23:34:26 +0000 (19:34 -0400)]
pimd: When nexthop_lookup fails allow a retry.

We are seeing situations where nexthop lookups are failing
unexpectedly.  Don't consider the lookup to have succeeded
in this case to allow the next lookup to work?

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Ignore (S,G) Prunes with no current state
Donald Sharp [Fri, 28 Oct 2016 19:25:56 +0000 (15:25 -0400)]
pimd: Ignore (S,G) Prunes with no current state

If we get a (S,G) Prune with no current ifchannel state, ignore
the neighbors request.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Find an interface that is both connected and setup for pim
Donald Sharp [Fri, 28 Oct 2016 17:43:13 +0000 (13:43 -0400)]
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>
7 years agopimd: Start (S,G,rpt) coding
Donald Sharp [Fri, 28 Oct 2016 17:23:17 +0000 (13:23 -0400)]
pimd: Start (S,G,rpt) coding

Start putting some infrastructure for (S,G,rpt) handling

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Clean up the interface deletion
Donald Sharp [Fri, 28 Oct 2016 00:35:22 +0000 (20:35 -0400)]
pimd: Clean up the interface deletion

When cleaning up the interface, actually clean up
data associated with that interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Make sure we have valid pointer when printing debugs
Donald Sharp [Thu, 27 Oct 2016 22:27:28 +0000 (18:27 -0400)]
pimd: Make sure we have valid pointer when printing debugs

When we print a debug in the pim_upstream_add, there
exists failure cases for pim_upstream_new where
we cannot create a upstream data structure.  Make
sure the debug handles it right.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix possible crash using 'struct pim_nexthop'
Donald Sharp [Thu, 27 Oct 2016 22:16:47 +0000 (18:16 -0400)]
pimd: Fix possible crash using 'struct pim_nexthop'

When passing in a nexthop data structure to nexthop_lookup
ensure that it is zero'ed out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Ensure 'struct nexthop' has been zeroed
Donald Sharp [Thu, 27 Oct 2016 22:13:19 +0000 (18:13 -0400)]
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>
7 years agopimd: Fix crash when cannot find igmp
Donald Sharp [Thu, 27 Oct 2016 22:09:09 +0000 (18:09 -0400)]
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>
7 years agopimd: Add basic nexthop lookup cached information.
Donald Sharp [Thu, 27 Oct 2016 15:54:55 +0000 (11:54 -0400)]
pimd: Add basic nexthop lookup cached information.

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>
7 years agopimd: Add the ability to get time in usec
Donald Sharp [Thu, 27 Oct 2016 16:26:00 +0000 (12:26 -0400)]
pimd: Add the ability to get time in usec

Add ability to return a int64_t time in usec.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix possible double free of upstream
Donald Sharp [Thu, 27 Oct 2016 12:05:57 +0000 (08:05 -0400)]
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>
7 years agopimd: Fix crash when igmp message comes in on non-configured interface
Donald Sharp [Thu, 27 Oct 2016 00:26:16 +0000 (20:26 -0400)]
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>
7 years agopimd: Fix child ifchannel overwrite parent ifchannel
Donald Sharp [Mon, 24 Oct 2016 02:35:47 +0000 (22:35 -0400)]
pimd: Fix child ifchannel overwrite parent ifchannel

When we look for child channels, don't overwrite the
parents ifchannel.  Leave that one alone.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: always build json for show commands
Daniel Walton [Wed, 26 Oct 2016 14:03:29 +0000 (14:03 +0000)]
pimd: always build json for show commands

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This cleans up the following so that they always collect the data to
display in json structures and then either dumps the json output or
traverses it to produce the non-json output.

  show ip pim local-membership
  show ip pim interface

7 years agopimd: Fix pim_nexthop_lookup
Donald Sharp [Tue, 25 Oct 2016 14:40:04 +0000 (10:40 -0400)]
pimd: Fix pim_nexthop_lookup

There are situations where we may never look at a better
route for nexthop_lookup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix uninitialized value
Donald Sharp [Tue, 25 Oct 2016 12:16:09 +0000 (08:16 -0400)]
pimd: Fix uninitialized value

When handling a igmp request, fill in group address before
we attempt to output debug information on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add interface to ifchannel debugs
Donald Sharp [Mon, 17 Oct 2016 12:33:13 +0000 (08:33 -0400)]
pimd: Add interface to ifchannel debugs

When outputting data about ifchannels due to debug
include the interface this is happening on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add debug for packet stats
Donald Sharp [Fri, 14 Oct 2016 17:15:30 +0000 (13:15 -0400)]
pimd: Add debug for packet stats

Allow us to figure out what is going wrong in some
situations, so add some debugs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix ifchannel being left around
Donald Sharp [Fri, 14 Oct 2016 15:22:12 +0000 (11:22 -0400)]
pimd: Fix ifchannel being left around

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>
7 years agopimd: Fix show of 'ip pim rp keep-alive-timer
Donald Sharp [Sun, 23 Oct 2016 00:23:08 +0000 (20:23 -0400)]
pimd: Fix show of 'ip pim rp keep-alive-timer

When displaying this changed value, we were
using an incorrect data value.

Signed-off-by: Donald Sharpd <sharpd@cumulusnetworks.com>
7 years agopimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]
Daniel Walton [Thu, 20 Oct 2016 14:09:30 +0000 (14:09 +0000)]
pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
7 years agopimd: add support for IGMPv2
Daniel Walton [Thu, 20 Oct 2016 13:34:29 +0000 (13:34 +0000)]
pimd: add support for IGMPv2

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-7962

7 years agopimd: Allow debugs entered in conf t mode to persist
Donald Sharp [Tue, 18 Oct 2016 00:10:12 +0000 (20:10 -0400)]
pimd: Allow debugs entered in conf t mode to persist

When entering debug commands under 'conf t' mode
allow the debugs to be saved for future fun and
adventure.

Ticket: CM-13213
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow mroute to return if incoming interface comes back
Donald Sharp [Thu, 13 Oct 2016 15:31:07 +0000 (11:31 -0400)]
pimd: Allow mroute to return if incoming interface comes back

If the incoming interface comes back, reinstall the channel oil
if the mroute is not installed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create channel_oil hash for quicker lookup
Donald Sharp [Thu, 13 Oct 2016 12:34:48 +0000 (08:34 -0400)]
pimd: Create channel_oil hash for quicker lookup

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>
7 years agopimd: Add hash lookups for upstream
Donald Sharp [Fri, 7 Oct 2016 14:25:08 +0000 (14:25 +0000)]
pimd: Add hash lookups for upstream

7 years agopimd: Only delete on KAT when created by stream
Donald Sharp [Wed, 12 Oct 2016 23:18:19 +0000 (19:18 -0400)]
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>
7 years agopimd: Fix message size read from kernel
Donald Sharp [Mon, 10 Oct 2016 19:31:27 +0000 (15:31 -0400)]
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>
7 years agopimd: Fix LHR both a receiver and a sender
Donald Sharp [Tue, 4 Oct 2016 11:56:09 +0000 (07:56 -0400)]
pimd: Fix LHR both a receiver and a sender

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fix include order for build
Donald Sharp [Fri, 7 Oct 2016 13:05:28 +0000 (09:05 -0400)]
zebra: Fix include order for build

7 years agopimd: Allow bigger packet sizes when receiving callbacks.
Donald Sharp [Mon, 3 Oct 2016 22:42:59 +0000 (18:42 -0400)]
pimd: Allow bigger packet sizes when receiving callbacks.

When receiving callbacks from the kernel allow bigger
packet sizes than 3k to be handled appropriately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix crash when looking at S,G from *,G
Donald Sharp [Tue, 27 Sep 2016 23:59:34 +0000 (19:59 -0400)]
pimd: Fix crash when looking at S,G from *,G

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>
7 years agopimd: 'sh ip pim int' showed local IP as the DR
Daniel Walton [Wed, 28 Sep 2016 22:57:31 +0000 (22:57 +0000)]
pimd: 'sh ip pim int' showed local IP as the DR

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
7 years agopimd: use JSON_C_TO_STRING_PRETTY everywhere
Daniel Walton [Wed, 28 Sep 2016 01:43:20 +0000 (01:43 +0000)]
pimd: use JSON_C_TO_STRING_PRETTY everywhere

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
7 years agopimd: 'show ip pim state json' use JSON_C_TO_STRING_PRETTY
Daniel Walton [Wed, 28 Sep 2016 01:35:22 +0000 (18:35 -0700)]
pimd: 'show ip pim state json' use JSON_C_TO_STRING_PRETTY

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-11812

7 years agopimd: initial "show ip pim state"
Daniel Walton [Wed, 28 Sep 2016 01:33:33 +0000 (01:33 +0000)]
pimd: initial "show ip pim state"

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-11812

superm-redxp-05# show ip pim state

Source           Group            IIF    OIL
20.0.13.253      230.10.10.1      br1    swp1
20.0.13.253      230.20.20.1      br1
0.0.0.0          230.40.40.1      swp1   br1
0.0.0.0          230.42.42.1      swp1   br1
0.0.0.0          230.42.43.1      swp1   br1

superm-redxp-05#
superm-redxp-05# show ip pim state 20.0.13.253

Source           Group            IIF    OIL
20.0.13.253      230.10.10.1      br1    swp1
20.0.13.253      230.20.20.1      br1

superm-redxp-05# show ip pim state 20.0.13.253 230.10.10.1

Source           Group            IIF    OIL
20.0.13.253      230.10.10.1      br1    swp1

superm-redxp-05#
superm-redxp-05# show ip pim state 230.40.40.1

Source           Group            IIF    OIL
0.0.0.0          230.40.40.1      swp1   br1

superm-redxp-05# show ip pim state 230.40.40.1 json
{
  "230.40.40.1":{
    "0.0.0.0":{
      "swp1":{
        "br1":{
          "source":"0.0.0.0",
          "group":"230.40.40.1",
          "inboundInterface":"swp1",
          "outboundInterface":"br1"
        }
      }
    }
  }
}
superm-redxp-05#

7 years agopimd: Print '*' for INADDR_ANY
Donald Sharp [Tue, 27 Sep 2016 15:06:12 +0000 (11:06 -0400)]
pimd: Print '*' for INADDR_ANY

When INADDR_ANY is sent to the pim dump function, return "*"

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: sort pim_ifchannel_list
Daniel Walton [Wed, 28 Sep 2016 00:40:58 +0000 (00:40 +0000)]
pimd: sort pim_ifchannel_list

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: sort qpim_channel_oil_list and qpim_upstream_list
Daniel Walton [Wed, 28 Sep 2016 00:14:22 +0000 (00:14 +0000)]
pimd: sort qpim_channel_oil_list and qpim_upstream_list

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This allows "show ip mroute" and "show ip pim upstream" to display the
groups in order.

7 years agopimd: Add debug wrapping around rp nexthop lookup
Donald Sharp [Mon, 26 Sep 2016 23:59:48 +0000 (19:59 -0400)]
pimd: Add debug wrapping around rp nexthop lookup

When looking up the RP only print debugs when
debugging is turned on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Added json to 'show ip igmp group'
Daniel Walton [Tue, 27 Sep 2016 16:37:38 +0000 (16:37 +0000)]
pimd: Added json to 'show ip igmp group'

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
root@superm-redxp-05[quagga-pim]# vtysh -c 'show ip igmp group'
Interface Address         Group           Mode Timer    Srcs V Uptime
br1       20.0.13.1       230.40.40.1     EXCL 00:03:24    1 3 00:01:28
root@superm-redxp-05[quagga-pim]#
root@superm-redxp-05[quagga-pim]#
root@superm-redxp-05[quagga-pim]# vtysh -c 'show ip igmp group json' |
python -m json.tool
{
    "br1": {
        "230.40.40.1": {
            "group": "230.40.40.1",
            "mode": "EXCLUDE",
            "source": "20.0.13.1",
            "sourcesCount": 1,
            "timer": "00:03:23",
            "uptime": "00:01:30",
            "version": 3
        },
        "address": "20.0.13.1",
        "flagBroadcast": true,
        "flagMulticast": true,
        "index": 96,
        "lanDelayEnabled": true,
        "name": "br1",
        "state": "up"
    }
}
root@superm-redxp-05[quagga-pim]#

7 years agopimd: Don't ask for information when you are notgoing to get an answer
Donald Sharp [Tue, 27 Sep 2016 03:13:42 +0000 (23:13 -0400)]
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>
7 years agopimd,zebra: Pass back error message if received
Donald Sharp [Tue, 27 Sep 2016 01:26:43 +0000 (21:26 -0400)]
pimd,zebra: Pass back error message if received

When zebra asks for mroute information let pim
know that the request failed or succeeded.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, pimd: Modify writen to retry on certain failures
Donald Sharp [Mon, 26 Sep 2016 20:37:08 +0000 (16:37 -0400)]
lib, pimd: Modify writen to retry on certain failures

When writen fails, allow itto retry on certain failures
until it succeeds.

Ticket: CM-12986
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fix up the debug for receiving multicast routes
Donald Sharp [Tue, 27 Sep 2016 02:27:37 +0000 (22:27 -0400)]
zebra: Fix up the debug for receiving multicast routes

Improve the netlink debug message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove some more unprotected warnings/debugs
Donald Sharp [Mon, 26 Sep 2016 22:39:54 +0000 (18:39 -0400)]
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>
7 years agopimd: Fix 'show ip mroute count'
Donald Sharp [Fri, 23 Sep 2016 20:16:38 +0000 (16:16 -0400)]
pimd: Fix 'show ip mroute count'

Add the lastused data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fixup to use new lastused
Donald Sharp [Fri, 23 Sep 2016 19:43:19 +0000 (19:43 +0000)]
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>
7 years agopimd: Fixup pim mroute output
Donald Sharp [Thu, 22 Sep 2016 14:50:43 +0000 (14:50 +0000)]
pimd: Fixup pim mroute output

Cleanup the 'show ip mroute' command to be a bit
more minimalistic.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Track upstream state a bit better.
Donald Sharp [Fri, 23 Sep 2016 15:10:31 +0000 (11:10 -0400)]
pimd: Track upstream state a bit better.

Track the upstream state if we are adding
a new state to a pre-existing upstream.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: When sending a register stop don't need a nbr
Donald Sharp [Thu, 22 Sep 2016 19:55:02 +0000 (15:55 -0400)]
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>
7 years agopimd: Stop join/prunes from crashing
Donald Sharp [Thu, 22 Sep 2016 17:25:48 +0000 (13:25 -0400)]
pimd: Stop join/prunes from crashing

When we receive a join/prune for a upstream
that we are unable to create, safely ignore
the request until the situation resolves itself.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow igmp query to go out immediately on startup
Donald Sharp [Wed, 21 Sep 2016 00:34:31 +0000 (20:34 -0400)]
pimd: Allow igmp query to go out immediately on startup

When starting up allow the 1st query to go out immediately,
well ok 1 second, and then the next queries to go out in
query_interval/4 seconds until startup mode is finished.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Do not send register stop in some cases
Donald Sharp [Wed, 21 Sep 2016 20:16:43 +0000 (16:16 -0400)]
pimd: Do not send register stop in some cases

When we are disabling pim, there exists some
race conditions where we are attempting
to send a register stop out a interface that
is not setup for pim yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Further work to fix rpf lookups and nbrs
Donald Sharp [Thu, 15 Sep 2016 20:50:08 +0000 (16:50 -0400)]
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>
7 years agopimd: Add debug messages as to why a register packet is rejected.
Donald Sharp [Mon, 19 Sep 2016 17:09:38 +0000 (13:09 -0400)]
pimd: Add debug messages as to why a register packet is rejected.

When we reject a register message from someone, give some reasoning
as to the why of it being rejected to help in debugging the situation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: "show ip mroute" skips entries without an OIF
Daniel Walton [Sat, 17 Sep 2016 04:10:44 +0000 (04:10 +0000)]
pimd: "show ip mroute" skips entries without an OIF

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
The entry for 230.10.10.4 was not being displayed

root@superm-redxp-05[pimd]# ip mroute show
(20.0.13.253, 230.10.10.4)       Iif: br1
(20.0.13.253, 230.10.10.1)       Iif: br1        Oifs: swp1
root@superm-redxp-05[pimd]#

root@superm-redxp-05[pimd]#
root@superm-redxp-05[pimd]# vtysh -c 'show ip mroute'
Proto: I=IGMP P=PIM S=STATIC O=SOURCE

Source          Group           Proto Input iVifI Output oVifI TTL Uptime
20.0.13.253     230.10.10.1     P     br1       1 swp1       2   1 00:01:09
20.0.13.253     230.10.10.4     P     br1       1 none       0   0 --:--:--
root@superm-redxp-05[pimd]#

7 years agopimd: JSON support for "show ip mroute"
Daniel Walton [Sat, 17 Sep 2016 03:52:58 +0000 (03:52 +0000)]
pimd: JSON support for "show ip mroute"

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-12876

root@superm-redxp-05[pimd]# vtysh -c 'show ip mroute json' | pjson
{
  "230.10.10.1": {
    "20.0.13.253": {
      "br1": {
        "swp1": {
          "group": "230.10.10.1",
          "iVifI": 1,
          "inboundInterface": "br1",
          "oVifI": 2,
          "outboundInterface": "swp1",
          "protocolPim": true,
          "source": "20.0.13.253",
          "ttl": 1,
          "upTime": "00:02:37"
        }
      }
    }
  },
  "230.10.10.4": {
    "20.0.13.253": {
      "br1": {}
    }
  }
}
root@superm-redxp-05[pimd]#

7 years agopimd: json support for "show ip pim" commands
Daniel Walton [Sat, 17 Sep 2016 02:22:02 +0000 (02:22 +0000)]
pimd: json support for "show ip pim" commands

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-12865

7 years agopimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORD
Daniel Walton [Thu, 15 Sep 2016 18:49:18 +0000 (18:49 +0000)]
pimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORD

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-11812

7 years agopimd: Turn off neighbor lookup for the moment
Donald Sharp [Thu, 15 Sep 2016 17:42:04 +0000 (13:42 -0400)]
pimd: Turn off neighbor lookup for the moment

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORD
Daniel Walton [Thu, 15 Sep 2016 17:16:36 +0000 (17:16 +0000)]
pimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORD

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-11812

7 years agopimd: Bad Bit shifts
Donald Sharp [Thu, 15 Sep 2016 15:14:53 +0000 (11:14 -0400)]
pimd: Bad Bit shifts

I programmed the bit shifts improperly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Rework approach for needing nbrs
Donald Sharp [Thu, 15 Sep 2016 14:18:28 +0000 (14:18 +0000)]
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>
7 years agopimd: Allow loopbacks to resolve
Donald Sharp [Thu, 15 Sep 2016 13:03:51 +0000 (09:03 -0400)]
pimd: Allow loopbacks to resolve

When doing a rpf check ensure that
if we've considered the RP to be a loopback
allow there to be no neighbor on the other
side.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Resolve rp after neighbor come up
Donald Sharp [Thu, 15 Sep 2016 12:00:42 +0000 (08:00 -0400)]
pimd: Resolve rp after neighbor come up

When a neighbor comes up, see if we suddenly
have a path to the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Only use paths that we have nbrs on
Donald Sharp [Thu, 15 Sep 2016 00:51:28 +0000 (20:51 -0400)]
pimd: Only use paths that we have nbrs on

When looking up nexthops for a path, we
should only allow nexthops that we
actually have neighbors formed for.  Otherwise
when we send join/prune messages they will
do nothing.

Ticket:CM-12754
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Don't assert when looking up a neighbor
Donald Sharp [Thu, 15 Sep 2016 00:45:00 +0000 (20:45 -0400)]
pimd: Don't assert when looking up a neighbor

Do not assert when looking up a neighbor, we don't know
if we have a neighbor don't punish us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd, zebra: Pass the ifindex for NEXTHOP_TYPE_IPV4
Donald Sharp [Wed, 14 Sep 2016 23:17:54 +0000 (19:17 -0400)]
pimd, zebra: Pass the ifindex for NEXTHOP_TYPE_IPV4

NEXTHOP_TYPE_IPV4 has the ifindex of the route.  Pass it
along so the other side can use it if it is needed.

This will make pim much happier in that we will need to do less
recursive lookups.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Use MULTIPATH_NUM for maxpaths
Donald Sharp [Wed, 14 Sep 2016 15:24:06 +0000 (11:24 -0400)]
pimd: Use MULTIPATH_NUM for maxpaths

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>
7 years agoPIM: json support for "show ip pim" commands
Daniel Walton [Wed, 14 Sep 2016 15:12:13 +0000 (15:12 +0000)]
PIM: json support for "show ip pim" commands

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-12865

7 years agoPIM: prefix-list support for selecting RP
Daniel Walton [Tue, 13 Sep 2016 19:41:33 +0000 (19:41 +0000)]
PIM: prefix-list support for selecting RP

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: CCR-5173
Ticket: CM-12819

7 years agopimd: Start noticing where upstream state came from
Donald Sharp [Tue, 13 Sep 2016 12:20:39 +0000 (12:20 +0000)]
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>
7 years agopimd: Add some additional upstream sources
Donald Sharp [Mon, 12 Sep 2016 23:51:02 +0000 (23:51 +0000)]
pimd: Add some additional upstream sources

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Switch all up->fhr to use up->flags
Donald Sharp [Mon, 12 Sep 2016 17:02:53 +0000 (17:02 +0000)]
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>
7 years agopimd: Allow flags to know if this is a FHR or not
Donald Sharp [Mon, 12 Sep 2016 16:50:30 +0000 (16:50 +0000)]
pimd: Allow flags to know if this is a FHR or not

Start the switch of storing if the upstream (S,G) is located
on the FHR or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Vif is not created in some startup conditions
Donald Sharp [Mon, 12 Sep 2016 23:30:27 +0000 (19:30 -0400)]
pimd: Vif is not created in some startup conditions

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>
7 years agopimd: Startup does not need to assert
Donald Sharp [Mon, 12 Sep 2016 19:09:28 +0000 (15:09 -0400)]
pimd: Startup does not need to assert

When pim starts up there is no need to assert in pim_init
if state is not set as wanted.  Especially for qpim_debugs
as that I would like to turn on debugs before we even start
doing anything in the code.

As for the PIM_MROUTE_IS_ENABLED, the variable is set
right above it, so no need to assert on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix high cpu load of pim when interface goes down
Donald Sharp [Mon, 12 Sep 2016 13:01:46 +0000 (09:01 -0400)]
pimd: Fix high cpu load of pim when interface goes down

When a interface goes down we accidently put ourselves into
an infinite loop.

Ticket: CM-12803
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoUnable to remove route-map from quagga
Daniel Walton [Fri, 9 Sep 2016 20:24:31 +0000 (20:24 +0000)]
Unable to remove route-map from quagga

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-12816

pim was missing route-map hooks

(cherry picked from commit 28b0c6b377e56e76c674c27e384238a755b173b2)

Conflicts:
pimd/pimd.c

7 years agopimd: Add some MSDP infrastructure
Donald Sharp [Thu, 8 Sep 2016 17:17:38 +0000 (13:17 -0400)]
pimd: Add some MSDP infrastructure

Add some very basic MSDP infrastructure to pim.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix unguarded log message
Donald Sharp [Wed, 7 Sep 2016 19:43:17 +0000 (15:43 -0400)]
pimd: Fix unguarded log message

In pim_rpf.c when we receive multiple paths for the
rpf we are complaining that we are not sure what
to do with it yet.  Change the _info to _debug
and don't print out unless we are debugging
stuff.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd, zebra: Allow v6 based nexthops to work in pim
Donald Sharp [Wed, 7 Sep 2016 19:36:43 +0000 (15:36 -0400)]
pimd, zebra: Allow v6 based nexthops to work in pim

When we get a v6 address/ifindex combo back from
a v4 lookup.  Check to see if the outgoing
interface only has one neighbor and if so
use that neighbors loopback address as
the route to use.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add the ability to lookup neighbor on a interface
Donald Sharp [Wed, 7 Sep 2016 19:34:29 +0000 (15:34 -0400)]
pimd: Add the ability to lookup neighbor on a interface

On a specified interface return the single
neighbor on that interface.

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