Commit Graph

1175 Commits

Author SHA1 Message Date
Quentin Young
21b3e44eb4
pimd: fix some null pointer derefs in cli
If pim/igmp is not enabled on an interface, the ->info pointer will be
null. Need to check that before dereferencing it.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-22 17:27:20 -04:00
Daniel Walton
53d829f5d4 pimd: Do not complain if re-joining an IGMP group
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

If you cut-n-paste an existing "ip igmp join 233.200.0.0 0.0.0.0"
command under an interface we should not return an error.
2017-09-18 16:01:21 +00:00
Renato Westphal
a2addae8fe *: use clang's 'ForEachMacros' format style option
This fixes the broken indentation of several foreach loops throughout
the code.

From clang's documentation[1]:
  ForEachMacros: A vector of macros that should be interpreted as foreach
  loops instead of as function calls.

[1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-15 14:53:46 -03:00
Jafar Al-Gharaibeh
461b76e4ed Merge pull request #1178 from donaldsharp/pim_obfuscation
Pim debugging and ferr start usage
2017-09-14 11:37:29 -05:00
Jafar Al-Gharaibeh
5b98937e2a Merge pull request #1175 from donaldsharp/pim_sg_rpt_bullshit
pimd: More S,G RPT prune state missinformation
2017-09-14 11:34:47 -05:00
Donald Sharp
37664928bd pimd: Allow igmp join messages to return more detailed errors
Start the conversion of pim configuration commands to use
the ferr side channel to allow more detailed information
to be returned to cli commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-14 11:17:32 -04:00
Donald Sharp
3d225d48f0 pimd: Add new 'debug pim nht rp' command
All the rp debugs were a mish-mash of TRACE or ZEBRA,
but the reality they were all focused on handling NHT
issues associated with the RP's.  So let's create
a new debug 'debug pim nht rp' if you are having
issues with RP's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-14 11:17:28 -04:00
Donald Sharp
37736d0870 pimd: More S,G RPT prune state missinformation
If you read the extra fine print of the PIM RFC
it asks you to stop the PP Timer and the
Expiry Timer when you are certain S,G RPT states.

This commit puts this into practice and it also
deletes the S,G ifchannel if necessary.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
2017-09-13 19:43:39 -04:00
Renato Westphal
8879bd2267 *: make all daemons call frr_fini() on exit
This allow us to find real leaks more easily with tools like valgrind.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-12 11:25:16 -03:00
Renato Westphal
b200bb7484 Merge pull request #1124 from donaldsharp/pim_igmp_fix
pimd: We do not need to BINDTODEVICE for default vrf
2017-09-07 15:04:54 -03:00
Donald Sharp
d1ee84e951 pimd: We do not need to BINDTODEVICE for default vrf
The changes introduced in PR #1044 caused pim to notice
when a setsockopt call failed.  The kicker here is that
this used to just work because we ignored the issue
pre.  So VRF's need to BINDTODEVICE to get igmp callbacks
but the default vrf does not need to do so.

With the fix we now see IGMP group join:
root@dell-s6000-02 ~/frr# vtysh -c "show ip igmp group"
Interface Address         Group           Mode Timer    Srcs V Uptime
br1       20.0.11.1       232.2.3.4       EXCL 00:04:14    1 3 00:00:05

Fixes: #1121
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-07 11:14:30 -04:00
David Lamparter
35a3c3c132 build: non-recursive pimd
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 16:20:42 +02:00
Donald Sharp
76260b3578 pimd: Add usage of vty_frame for vrf configuration
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05 18:56:40 -04:00
Jafar Al-Gharaibeh
959768e8d0 Merge pull request #1044 from donaldsharp/combination
Coverity Cleanup of Stuff
2017-08-31 10:25:55 -05:00
Donald Sharp
89b680829e pimd: Add ability to lookup RP group by table.
This feature does this:

Add the ability to store the non-prefix static RP
entries into a table.  Then to lookup the G to
find the RP in that table, finding the longest
prefix match across both prefix-lists and
static RP's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31 10:30:19 -04:00
Donald Sharp
b77b155068 pimd: Match on longest prefix when searching for RP
When we are searching for a RP to use, amongst
many RP's and separate prefix-lists, Match on
the longest prefix specified to choose the
correct RP.

Example:
ip pim rp 4.3.2.1 prefix-list A
ip pim rp 4.3.2.2 prefix-list B
ip pim rp 4.3.2.3 prefix-list C

ip prefix-list A seq 5 permit 225.0.0.0/8
ip prefix-list B seq 5 permit 225.1.0.0/16
ip prefix-list C seq 5 permit 225.1.1.0/24

Old behavior:  Group 225.1.1.14 comes in and
we need to find the RP to use, we would match
on the first prefix-list A( since we are searching
based on a sorted link list of RP address ) and
select 4.3.2.1 as our RP

New behavior:  Group 225.1.1.14 comes in and
we need to find theRP to use, we now will
match on C( longest prefix match ) and select
4.3.2.3 as our RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31 10:30:19 -04:00
Donald Sharp
093c928fc1 pimd: Improve handling in pim_rp_init
When we are starting up improve the error handling of
pim_rp_init and fix some memory leaks.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31 10:30:19 -04:00
Donald Sharp
ea89ab14e2 pimd: Smarten up pim_nexthop_lookup
There exists cases where we have not properly configured
a RP yet, but we are getting callbacks for nocache.
This is generating allot of spam messages in the log.

In the case where we attempt to lookup INADDR_NONE
just say it fails without need to talk to anyone
since we'll never get a real answer from zebra
anyways.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31 10:30:19 -04:00
Donald Sharp
2f5b00289d pimd: Fix pim->keep_alive_time missed patch
The commit '19b807c pimd: Allow the keepalive time to be per vrf.'
is missing some data.  Probably as a result of the indentation
and I accidently dropped it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-30 07:49:51 -04:00
Donald Sharp
019eb073a2 pimd: Add missed frame for vrf based interface
pim is vrf aware and the interface based line for vrf's was
not being started with a vrf_frame as the non interface
based line was.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-30 07:39:46 -04:00
Donald Sharp
15fa39c51c pimd: Fix indentation issue that slipped in?
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-30 07:39:01 -04:00
David Lamparter
a8b828f3c3 *: remove empty "interface XYZ" config blocks
Using the previously-added vty_frame() support, this gets rid of all the
pointless empty "interface XYZ" blocks that get added for any interface
that shows up in the system (e.g. dummys, tunnels, etc.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
David Lamparter
a97986ffba *: fix compiler warnings
Specifically, gcc 4.2.1 on OpenBSD 6.0 warns about these;  they're bogus
(gcc 4.2, being rather old, isn't quite as "intelligent" as newer
versions; the newer ones apply more logic and less warnings.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-26 01:46:40 +02:00
Donald Sharp
e691f179b6 pimd: Cleanup a variety of SA issues
1) Error check return from setsockopt and sockets
2) Check return codes for str2prefix
3) Clean up some potential NULL References

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24 20:34:28 -04:00
Donald Sharp
c206937b91 pimd: Cleanup S,GRPt prune handling on Mroute Loss
1) Clean up display of S,GRPt prune state to be more meaningful
2) Upon receipt of a S,GRPt prune make sure we transition to
   the correct state
3) Upon loss of a S,GRPt prune make sure we transition to
   the correct state as well as immediately send a *,G
   join upstream to propagate the loss of the prune.
4) Removal of a weird S,G state being installed upon
   loss of a S,G RPt prune.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24 10:01:50 -04:00
Donald Sharp
6c65db5f99 pimd: Cleanup a debug for vrf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24 10:01:50 -04:00
Donald Sharp
87f6dc504d *: Add 'show debugging' command from vtysh
Allow vtysh to query every daemon about its
debugging status in one go.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-21 07:23:59 -04:00
Jafar Al-Gharaibeh
f887261b92 Merge pull request #1003 from donaldsharp/pim_mem_leak
pimd: Fix memory leak on failure case
2017-08-18 00:16:38 -05:00
Jafar Al-Gharaibeh
fd178a6a04 Merge pull request #1001 from dwalton76/pimd-CMD-WARNING
pimd: "No Path to RP address specified" should exit 0
2017-08-18 00:15:37 -05:00
Donald Sharp
a5d4c69d6a pimd: Fix memory leak on failure case
When we fail to create upstream we were not properly
cleaning up all memory.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-17 13:05:08 -04:00
Daniel Walton
c6e7b95248 pimd: "No Path to RP address specified" should exit 0
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This could happen if routing isn't up yet but the command did take so we
should exit 0 here.  Testing:

root@cel-redxp-10[frr-dwalton76]# vtysh -c 'conf t' -c' ip pim rp
11.11.11.11'
% No Path to RP address specified: 11.11.11.11
root@cel-redxp-10[frr-dwalton76]# echo $?
0
root@cel-redxp-10[frr-dwalton76]#
2017-08-17 15:04:25 +00:00
David Lamparter
c9974c7995 Merge pull request #984 from donaldsharp/debugging
Some Small Pim Issues
2017-08-16 19:18:31 +02:00
David Lamparter
1208e7bca2 Merge pull request #979 from donaldsharp/ifchannel_fix
pimd: Ensure cleanup of S,G on ifchannel failure to create
2017-08-16 19:16:46 +02:00
David Lamparter
ad5c17afcd Merge pull request #972 from chiragshah6/mdev
Pim Bfd related changes
2017-08-16 19:14:08 +02:00
Donald Sharp
47bf9e213a pimd: Add 'show ip msdp vrf all sa ...' command
Allow the ability to iterate over all vrfs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15 16:37:13 -04:00
Donald Sharp
15507b63e6 pimd: Rename duplicate JSON key
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15 10:31:09 -04:00
Donald Sharp
8dbdb215b3 pimd: Add more vrf debugging to pim_upstream.c
Cleanup a few missed spots of debugging to know
what vrf we are talking about.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15 10:17:33 -04:00
Donald Sharp
2243bb17bd pimd: Allow user to specify ip address for 'no ip pim use-source'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15 10:16:51 -04:00
Donald Sharp
c6f94e1971 pimd: Ensure cleanup of S,G on ifchannel failure to create
There exists a path for ifchannel creation that if a S,G
fails to create and a corresponding *,G ifchannel is there,
the S,G will be deleted but we were leaving the S,G in the
*,G ifchannel sources list.  Remove from the list in this case

Ticket: CM-17605
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-14 20:16:48 -04:00
Chirag Shah
df83d4e19d pimd: pim bfd vrf aware
BFD replay for all interfaces was only considering VRF_DEFAULT interface
list.
The change will walk all VRFs, interface list per VRF to register pim
neighbor with BFD.

Signed-off-by: Chirag shah <chirag@cumulusnetworks.com>
2017-08-13 17:41:01 -07:00
Chirag Shah
2fd8de7d96 pimd: Fix pim bfd config order dependecny
Upon frr restart vtysh replays pim bfd configuration
cli before pim sm command, this results in failure
of pim bfd config on the VIF as it is not pim enabled yet.
Inside pim bfd configuration, call to create PIM vif
handler if it is not created yet.
no ip pim bfd, if pim is not enabled display warning and return.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-08-13 17:28:11 -07:00
Donald Sharp
a7f95c7671 pimd: Remove mroute when RPF is gone
This does three things:

1) When we get a RPF_FAILURE, remove the mroute associated
with it.
   -> This way when the RPF comes back we can just add the
      mroute in as part of the normal scanning process.
2) When we do a ecmp_nexthop_search return 1 when we found
something we can use.
3) Ignore output from pim_update_rp_nh
   -> When we do a ecmp_nexthop_search ignore the return
      code and do not attempt to gather it up to return
      to the calling function.  It is just ignored
      and we were not taking into account the what of
      multiple RP's we were looking at.

Ticket: CM-17218
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-11 07:36:47 -04:00
Donald Sharp
8022df6a6d pimd: Single Upstream join when Keepalive timer pops
If a single S,G is being deleted because the keepalive
timer has timed out, Send a *,G join upstream to clear
the S,G RPT prune bit.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-11 07:36:47 -04:00
Jafar Al-Gharaibeh
68b39ad41b Merge pull request #922 from qlyoung/pim-cli
pimd: some pim cli fixes
2017-08-07 13:19:11 -05:00
Quentin Young
9643e2c75b
pimd: some pim cli fixes
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-07 12:42:05 -04:00
Donald Sharp
f09eaf1c8e pimd: Fix crash on iface down due to secondary address list
The secondary address list was being added/removed as
we went.  I see no reason to have special bookkeeping
for this list.  Just add it on interface startup and
then remove it on deletion.  Removes some
very specialized coding that was saving a very small
amount of space.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-03 18:24:28 -04:00
Donald Sharp
8e7a4c6e2b pimd: Lookup S,G ifchannel after we create it
There are situations where we receive a *,G with
a S,G,RPT Prune embedded where we do not actually
have any S,G yet(MSDP with multiple RP's with the
same address).  As such since we only need to
lookup the S,G ifchannel once, do it after
the recv_prune.

Ticket: CM-17230
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-03 18:24:28 -04:00
Donald Sharp
69ccd63e57 pimd: Squash some more memory leaks
When a interface is flapped we were leaking some memory
associated with link lists.  Especially in the jp_agg
code.  If your network was/is stable and you are not
running at any scale you probably would not see this
as impactful at all.

Ticket: CM-16392
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 15:39:10 -04:00
Donald Sharp
13221cf2b4 pimd: Clean back pointer upon deletion
The channel_oil has a back pointer(up) to the upstream data structure.
If we are planning on keeping the channel oil (due to ref count issues)
longer than keeping the upstream, when we delete the upstream we were
not clearing the back pointer to up.  This would result in a situation
where if that memory has started to be used again it will cause a
crash and other fun things.

Ticket: CM-17092
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 12:14:11 -04:00
Donald Sharp
cc14df1391 pimd: Add ip pim rp keep-alive-time X
Ticket: CM-17134
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 08:17:36 -04:00
Donald Sharp
d62fd596f9 pimd: Add some more vrf debug information
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:57:24 -04:00
Donald Sharp
209a56799b pimd: Cleanup nht debugs
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:57:24 -04:00
Donald Sharp
08f4f9013c pimd: Clean up mroute_add_vif debugging
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:57:13 -04:00
Donald Sharp
ad7b74c4f7 pimd: Convert to using a RB tree for the pim_ifp ifchannel_list
This patch does two things:
1) Converts the pim_ifp->ifchannel_list to a pim_ifp->ifchannel_rb
2) Removes the hashing to use the RB RB_FIND instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:44:00 -04:00
Donald Sharp
86b473a7e8 pimd: Rename pim_ifp->pim_ifchannel_list
Remove the redundant information in pim_ifp->pim_ifchannel_list
just call it pim_ifp->ifchannel_list

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:44:00 -04:00
Donald Sharp
1a8a3da8c2 pimd: Remove almost duplicate pim->ifchannel_list
The pim->ifchannel_list can be duplicated by iterating
over each vrf and then over each pim_ifp->pim_ifchannel_list
Since list handling is taking allot of time at scale
convert over to using this value.

Additionally clean up pim_cmd.c to have helper functions
to handle the actual encoding of data for output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:44:00 -04:00
Quentin Young
07a2935559 pimd: fix show ip msdp... NPD when vrf unknown
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-28 08:11:28 -04:00
Donald Sharp
3da8a09979 pimd: Fix msdp cleanup issues
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-28 08:08:40 -04:00
Donald Sharp
19b807ca17 pimd: Allow the keepalive time to be per vrf.
Allow the keepalive period to be per vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-28 08:03:50 -04:00
Donald Sharp
9fb302f41d pimd: Setup hash names appropriately
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25 14:22:15 -04:00
Donald Sharp
7c59195031 pimd: NHT upstream list is inefficient
The NHT upstream list at scale is horribly inefficient due to keeping
a sorted list of upstream entries.  The attempting to find
the upstream and the insertion of it into the upstream_list
was consuming a large amount of cpu cycles.

Convert to a hash, allow add/deletions to effectively become
O(1) events.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25 14:18:57 -04:00
Donald Sharp
6e1ef388f3 pimd: Clean PNC cache handling on shutdown
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25 14:18:57 -04:00
Donald Sharp
f5da2cc2d8 pimd: Use JSON_STR
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25 08:19:57 -04:00
Donald Sharp
d5c5e362b2 pimd: Warn to stderr in failure case for test_igmpv3_join
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:57:51 -04:00
Donald Sharp
467c85f730 pimd: Cleanup unused assignment
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp
bd4d05c577 pimd: Fix missing docstring in 'no debug pim trace detail'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp
49fde801fa pimd: Fix linux build on older kernels
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp
1b5f8a1a21 pimd: Stop looking when we find a matching nexthop
When we receive a new ecmp path and the old nexthop is still
valid.  There existed some cases where we would continue looking
for a nexthop( and thus loose the fact that we had found it )
after found.

Ticket: CM-16983
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp
aabb9a2f07 pimd: Allow installation of NULL mroute in some situations
When we receive a S,G,RPT prune as part of a *,G tree, install
the NULL oil S,G mroute.  This will cause the traffic to stop
flowing for this particular S,G as we expect.

Ticket: CM-16978
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp
5c3aac90d9 pimd: Fix 'show ip mroute vrf all count' crash
'show ip mroute vrf all count' crashes currently

This commit fixes that issue

Ticket: CM-17052
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp
a25de56b58 pimd: Add 'vrf all' commands where needed
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:55 -04:00
Donald Sharp
74d1799ae6 pimd: Fix unininitialized data usage found by clang
clang 5.0 to the rescue!

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp
d3a551b952 pimd: Fix pim not recognizing itself as an RP in some cases
During normal course of operations, zebra sends the ZEBRA_INTERFACE_VRF_UPDATE
call up into all connected zclients.  In the case of PIM the
zlookup was expecting a min length of 10, but ZEBRA_INTERFACE_VRF_UPDATE
was sending of size 6.  This min length check makes no sense,
so just remove.

Ticket: CM-16976
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp
5cef40fcb7 pimd: Fixup NHT debugging to be a bit more coherent
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp
40f1f31be6 pimd: Add debug pim nht command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp
862756ff85 pimd: Ensure that we properly shutdown threads on start failure
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp
64c8653095 pimd: Put 'struct pim_instance *' as the first function parameter
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp
1e7a3a2a53 pimd: Fix some small crashes in pim
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
9c80de2434 pimd: Fix crash with ifchannel and upstream
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
df766618e2 pimd: Set sptbit when we send the register stop
Ticket: CM-15512
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
b283a4ca38 pimd: Add 'show ip mroute vrf all [json]' command
Add the ability to dump all the vrf's associated
with pim.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
0885a9f1f4 pimd: Fix code to not send joins when SGRPT Prune is received
When we receive a SGRPT Prune we were switching the upstream
to JOINED and immediately sending a join.  This was not
the right thing to do.

This was happening because we were making decisions about the
new ifchannel before it was fully formed.

Rework ifchannel startup to provide enough information to
the pim upstream data structure to make the right decisions

Ticket: CM-16425
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Chirag Shah
96ceedc7a2 pimd: display down ports show ip pim interface
In show ip pim interface and  show ip pim interface <intf>
display State "down" pim enabled interfaces.

Ticket:CM-16809
Reviewed By:CCR-6398
Testing Done:
show ip pim interface
Interface  State          Address  PIM Nbrs           PIM DR  FHR IfChannels
br1           up          2.0.1.1         0            local    0          0
lo            up          6.0.0.1         0            local    0          0
pimreg        up          0.0.0.0         0            local    0          0
swp1        down          6.0.1.1         0            local    0          0
swp2          up          6.0.2.1         1            local    0          0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
cc61055f0e pimd: Add a check for needing spt bit in register_recv
When we receive a register message for an existing S,G
and the SPT bit is not set, then do a quick check against
the S,G to see if we have counters updated.  This is added
because the existing S,G wheel_timer only updates every
31 seconds and it is possible for a Null Register to
have come in before that first 30 second timer pops.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
8975cc559b pimd: Remove unnecessary debug.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
a895ac3029 pimd: Ensure that (S,G) output is consistent
Ensure that displayed (S,G) output in logs is
consistent for all debugs.  This will make it
easier to grep for interesting data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
38de2445c5 Revert "pimd: Modify wait time for response from Null Register"
This reverts commit 70989c7c20.
2017-07-24 13:51:40 -04:00
Donald Sharp
20a7e5fd85 pimd: Fixup PIM to handle vrf autocompletion
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
c77a04e427 pimd: Only add a igmp socket if the address is ipv4
When the secondary addresses got expanded to allow
v6 on the list, we needed to limit the igmp sockets
to just v4 currently.

Ticket: CM-16858
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
9853a7a5b1 pimd: Fix ambiguous command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
6e89ed94f8 pimd: Convert code to handle vrf autocompletion
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
01460fbca3 pimd: When we get nexthops back we may not have configured pim on all intfs
Be aware that we may not have pim configured on all interfaces when
we have a failure situation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
3af2452c04 pimd: Prevent Lockup when waiting for response from zebra
When we have vrf config that we have not fully setup yet,
(ie zebra knows nothing about it yet), when attempting to
do a nexthop_lookup, zebra will just drop the request
if it doesn't know about the vrf.

In this case, we need to safely not ask for the information

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
449a3f5b10 pimd: Wisely delay startup of msdp listen/connect when vrf is not fully up
When we do not really have the vrf up, wisely do not attempt
to dereference the ifp looked up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp
05d8470ff5 pimd: Fix crash when looking up incoming interface
It is possible that the incoming interface lookup
will fail because we are in transition from one vrf
to another.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
b5f3a428f2 pimd: We need to trace removal of non v4 addresses too
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
90133de64c pimd: Allow pim to work in vrf's without explicitly configuring the vrf device
Under vrf's pim needs to have a socket listening for pim packets on the vrf
device so that we can actually get the packets.  As such when we configure
up a vrf interface, configure just enough to allow it to listen on the
device and to do the right thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
2aa1ca8418 pimd: When we are initializing a pim socket limit hellos
When we are initializing a pim socket for vrf or loopback
interfaces do not schedule a hello to go out at all.

I'm currently leaving the check on is a vrf / loopback
device on the actual send as that we have several paths
to get there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
1f9666a1db pimd: Remove knowledge of HAVE_TCP_ZEBRA from pim
pim was the only routing daemon to have any knowledge
of how zebra connects to each daemon.  There is no
need for this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
a5b6bd2be3 pimd: Ensure packet received on vrf interface is configured for pim
In a vrf configuration, when we receive a pim packet we lookup
the correct incoming interface.  There exists a chance that
the correct incoming interface has not been configured to use
pim yet.  gracefully bow out and do nothing with the packet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
e0ae31b886 lib, pimd, zebra: Allow pim to set pimregX into appropriate vrf
The pimregX devices when created by the kernel are put into
the default vrf.  When pim gets the callback that the device
exists, check to see if it is a pimregX device and if so
move it into the appropriate vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
2267994ca9 pimd: Bind msdp listen socket to vrf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
7f1d002a04 pimd: Cleanup shutdown of vrf
When shutting down the vrf don't kill the default vrf
when attempting to cleanup something else.

Also move the terminate to the right spot.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
200e2fe4d1 pimd: Fix msdp show command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
62fde40935 pimd: For non-default vrf's bind the msdp socket to the vrf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
56243c3a4a pimd: Fix 'show ip pim state...' vrf changes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
5667319bcf pimd: debug guard error message
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
a57103e963 pimd: Cleanup some join debug messages
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
5f40dadaf0 pimd: Fix help string
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp
56c238c9e9 pimd: Add 'debug pim trace detail' command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
9487552c1c pimd: Reschedule the correct interface for incoming packets
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
e2d451e2ee pimd: Trust the recvfromto ifindex information
The vrf interface is receiving the pim packet
instead of the slave interface that is bound.

Lookup the ifindex ifp pointer from that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
11699c4788 pimd: Don't send hello's out vrf interface
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
1ef8c24eb9 pimd: We may receive a igmp packet in on unconfiged intf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
466e4e5b16 pimd: Fix dropped(?) telling of the kernel to recv cmsg data
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
1b973cb7c0 pimd: Fix mixup in addition to vrf node
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
90450a3d25 pimd: Bind pim kernel fd to appropriate vrf
Bind the pim kernel fd to the appropriate vrf, modify
the callback up into pim with the IGMP report to
retrieve the incoming interface and use that to
lookup the correct interface to use.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
10c899e20e pimd: Push 'struct pim_instance *' a bit further
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
1eca85760b pimd: Fix crash when attempting to use channel_oil->pim before it is assigned
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
2002dcdb94 pimd: Cleanup some basic crashes from mistakes made converting to vrf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
bc14b6c7a4 pimd: Fix crash in 'show ip multicast vrf..'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
c68ba0d7bf pimd: Convert pim_cmd.c to use correct pim instance
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
b4575b3aa0 pimd: Fix instance startup to separate data structure setup from use
Fix the instance startup to allow separation between the data structure
setup for pim instances from actual attempt to use.  More than
likely there will be other issues that need to be fixed but
this gets us 'working' again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
f02d59db8b pimd: Add vrf help strings to some commands
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
c3169ac780 pimd: Start 'show ip pim [vrf NAME] ...' conversions
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:38 -04:00
Donald Sharp
7c2bfc2a1d pimd: Add some vrf knowledge to some debugging statements
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
02a16316f3 pimd: Add vrf ability to msdp show commands
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
4f9f3925d6 pimd: All CONFIG_NODE commands are now available in VRF_NODE
Note -> Some commands storage needs to be moved into pim_instance

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
ae4a6b57ca pimd: Create macro to get appropriate pim instance
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
c9657fdc91 pimd: Cleanup the rest of the global config to be vrf aware for spacing
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
0c8b717ee6 pimd: Add code to write spaces or not before 'ip pim rp'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
9ecb7b7747 pimd: Get show run to display vrf sub mode
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
4097373f90 pimd: Fix intentional pass of NULL
pim_msdp_pkt_sa_gen is intentionally passed mp as NULL
in some cases, so we need to pass through the pim instance

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
6d3c195375 pimd: Fix startup of pim instance a bit
We will need to refine the difference between create and enable
of a pim instance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
b11e234147 pimd: Fix crash associated with pim_ifp not actually being created yet
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
92b422f1b7 pimd: Cleanup pim_msg.c to use correct pim instance
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
71ad9915e7 pimd: Make pim_ssmpingd.c 'struct pim_instance' aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
472ad3832c pimd: Make msdp struct pim_instance * aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
2ad78035cc pimd: Make pim MSDP pim instance aware to some extent
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
6196ed7154 pimd: Get the default pim code ready to write into vrf's or not
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
a01538df21 pimd: Allow PIM to start writing vrf information if it has it
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
ef434d3e39 pimd: Cleanup pim_pim use of pimg
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
e52e322341 pimd: Cleanup pimg from pim_igmpv3.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:37 -04:00
Donald Sharp
896b2044c7 pimd: Lookup loopback based upon vrf correctly.
The vrf loopback ip address should be associated with the
vrf device for vrf's, else use the loopback.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
6f439a7058 pimd: Cleanup pim_ssm.c to use 'struct pim_instance *'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
cc0cecae78 pimd: Finish up pimg -> pim conversion in pim_rpf.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
ac7eaeb401 pimd: Cleanup missed pimg
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
9a0f71c994 pimd: Finish up pim_mroute.c 'struct pim_instance' awareness
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
88a3f5e121 pimd: Make pim_hello choose correct vrf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
8e5f97e3c1 pimd: Cleanup pimg from pim_upstream.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
71edad0fd5 pimd: Make zlookup 'struct pim_instance' aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
6f932b0c91 pimd: Make XX_forward_start 'struct pim_instance *' aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
611925dc02 pimd: Convert channel_oil_hash and list into 'struct pim_instance *'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
7cfc7bcfe7 pimd: Convert vif and ifindex lookups to use 'struct pim_instance *'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
f88df3a642 pimd: Move pim_ifchannel_list and vif array into 'struct pim_instance *'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
5ec5d976eb pimd: Remove pimg from pim_iface.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
b206566b16 pimd: Remove pimg from pim_register.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
b236555851 pimd: Cleanup pim_jp_agg_upstream_verification function
Do not use pimg, figure out which instance we are in and use that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
d9c9a9ee06 pimd: Convert pim_rp.c to use 'struct pim_instance *'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:36 -04:00
Donald Sharp
9b29ea95fc pimd: Remove pimg from pim_upstream.c
Move the upstream_list, hash and wheel into 'struct pim_instance'
Remove all pimg to pim in pim_upstream

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
fec883d95a pimd: pim_rp.c -> convert pimg to pim
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
25b787a287 pimd: Remove pimg from pim_nht.c in totality
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
cf663cebb3 pimd: More refactor for 'struct pim_instance *' for pim_nht.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
25bdac421e pimd: Add 'struct pim_instance' to find_or_track_nexthop
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
d0a4f55d5d pimd: Make nexthop cache pim instance aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
f509d94116 pimd: Fix mistake in uplifting to new thread model
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
cb9c7c50d3 pimd: Refactor some functions
A bunch of functions had return values that were never
checked for ( and not needed ) and opposite return values
for proper calling function boolean logic.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
da82728dbf pimd: Have pim_if_find_by_vif_index iterate over all vrf's
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
4e0bc0f0a8 pimd: Refactore qpim_static_route_list into pim->static_routes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
2e4e8571f0 pimd: Fix c_oil->pim set spot
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
c2cf4b0230 pimd: Refactor code to be in better spots
1) Create pim_instance.[ch] to allow us to handle the instance information there
2) Refactor some pim_rpf_ and some pim_rp commands into appropriate files and
appropriate includes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
72ec467289 pimd: Set c_oil->pim for static routes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
856e863fda pimd: If c_oil->pim is set use that pim instance in pim_mroute.c
As a transitory mechanism, if c_oil->pim is set, use that particular
pim instance, else use the default pimg.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
024d6a751d pimd: Add vrf output to 'interface ...' write command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
8395de9a9c pimd: Fix 'show ip multicast'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:35 -04:00
Donald Sharp
ecca97acb3 pimd: Modify 'show ip multicast' to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
afa2b17920 pimd: Create the pimreg device name correctly
The pimreg device name should be based upon the
tableid we create( as that this is what the kernel does )

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
44a1bd88ee pimd: Use actual vrf table_id for pim vrf creation
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
43e40fdfe1 pimd: Create the pimreg per vrf 2017-07-24 13:51:34 -04:00
Donald Sharp
18d8291fa2 pimd: Create pim_get_pim_instance
Create function to get the pim instance from the vrf_id

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
ea3d967be0 pimd: pim_mroute_[add|del]_vif become VRF aware
Make the pim_mroute_[add|del]_vif functions be vrf aware.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
c3bd5a10f1 pimd: Store the pim instance off of the pim interface
Storing the pim instance off of the pim interface will allow
us to easily keep track of vrf information.  This is because
pretty much is everything is interface based.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
f507c1966e pimg: Actually properly create the pim socket per vrf
Create the actual pim socket per vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
1145d0256e pimd: Start cleanup of documentation
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
405d63578a pimd: Convert upcalls from kernel to use appropriate pim instance
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
8ea5d94477 pimd: Move thread read to struct pim_instance
When we are handling the thread read/writes for
a pim mroute socket, make it so that it can
be appropriately handled by the 'struct pim_instance'
instead of defaulting to the default VRF's

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
cdbfaec57b pimd: Call code to create appropriate MRT_TABLE
When dealing with vrf's we need to create a table within
the linux kernel to handle the vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
a88e628d29 pimd: Remove unnecessary NULL check
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
61e99c94ae pimd: Ensure a 0 read fails cleanly
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
9403d28515 pimd: Prevent NULL dereference
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
2e8345c139 pimd: Error check str2prefix
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
767a7788b9 pimd: Fix unchecked return value
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
e07fe9e658 pimd: Save pim instance on vrf pointer
This commit does these things:

1) Saves the pim instance created on the vrf pointer
2) Moves some initialization to the proper spot.
3) Remove vrf_id from 'struct pim_ssm' it is not needed
4) Removes some checks to prevent non-default vrf's from
being created.
5) When creating the pim instance, save default vrf in pimg to allow backwards compatibility

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
6beed98735 pimd: Modify pim_mroute_socket_[enable|disable] to be vrf aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:34 -04:00
Donald Sharp
fe232c1948 pimd: Use setsockopt_so_recvbuf instead of doing it ourselves
This change allows other non-linux platforms to be a bit
more forgiving if we ask for a very very large size.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:33 -04:00
Donald Sharp
ff673f4525 pimd: Start conversion of socket and counters for VRF
Convert the socket fd to be owned by the pimg pointer as
well as the counters associated with the fd.  This will
allow us to future proof our code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:33 -04:00
Donald Sharp
0708beb1f4 pimd: Cleanup use of VRF_DEFAULT to pimg->vrf_id
Use the appropriate vrf_id instead of always defaulting
to VRF_DEFAULT

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:33 -04:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
David Lamparter
2d8270596a Merge remote-tracking branch 'frr/master' into newline-redux
Lots of conflicts from CMD_WARNING_CONFIG_FAILED...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 13:07:30 +02:00
David Lamparter
625e016d14 *: remove VTYNL, part 6 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
61b7d449bd *: remove VTYNL, part 3 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
6d3c2ed4ed *: remove VTYNL, part 1 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
181039f3d7 *: ditch vty_outln(), part 2 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:19:58 +02:00
Daniel Walton
f1a05de982 vtysh: return non-zero for configuration failures
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This allows frr-reload.py (or anything else that scripts via vtysh)
to know if the vtysh command worked or hit an error.
2017-07-13 19:56:08 +00:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
Quentin Young
7111c1a0cd
*: fix excess docstring
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05 15:33:00 -04:00
Quentin Young
dfd19ccc3a
*: update hash_create(), hash_create_size()
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-01 19:18:37 -04:00
Donald Sharp
da13682c88 pimd: Fix zclient cleanup on shutdown
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30 10:32:45 -04:00
Quentin Young
e31b6333f4 *: vty_outln (vty, "") --> vty_out (vty, VTYNL)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:56 +00:00
Quentin Young
1318e7c841 *: s/VTY_NEWLINE/VTYNL/g
Should be able to fit more vty_out onto one line now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:54 +00:00
Quentin Young
96ade3ed77 *: use vty_outln
Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:31:28 +00:00
Chirag Shah
925574ba66 pimd: move variable declartion outside of switch
To Address ICC (intel CC) warning, moving variables
declaration out of switch statement.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-06-15 12:20:59 -07:00
Donald Sharp
71007eab71 pimd: Cleanup ifp->info setup
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-13 13:28:20 -04:00
Chirag Shah
f6a1dd837b Merge branch 'master' of https://github.com/FRRouting/frr into pim_dev 2017-06-06 09:59:29 -07:00
David Lamparter
326452238a Merge branch 'stable/3.0'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-06 17:37:41 +02:00
Chirag Shah
72a83d6daa pimd: fix pim bfd crash and bfd neigh down
During running config, all IFPs are traversed, bfd interface config write
need to check for ifp->info null in case pim info is missing and skip the interface.

bfd update for address change need to check if particular pim neighbor's address matches
with bfd address update

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-06-05 18:21:52 -07:00
Renato Westphal
247e6469da Merge pull request #657 from donaldsharp/rompapotamus
Rompapotamus
2017-06-03 18:52:59 -03:00
Donald Sharp
7656e7fc46 pimd: Remove qpim_inaddr_any
In prep for switching over to having PIM understand VRF
remove the qpim_inaddr_any global variable and just
use INADDR_ANY directly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-02 13:44:37 -04:00
Donald Sharp
bade23d3b0 pimd: Remove some unneeded debugs from pim
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-01 20:11:19 -04:00
David Lamparter
68b2595ec9 Merge pull request #576 from chiragshah6/pim_dev
pimd: pim bfd support
2017-05-30 14:37:08 +02:00
Jafar Al-Gharaibeh
f3d2ef782d Merge pull request #583 from chiragshah6/pim_dev_3_0
pimd: Fix to Transmit S,G Join when transitioning from SGRpt to Join state
2017-05-29 12:37:26 -06:00
Donald Sharp
ad5233c886 pimd: Allow secondary address comparisons to work
The secondary address comparison done to determine if we are
an RP for a specified address was comparing A.B.C.D/32 to A.B.C.D/0
because when we created the rp_info we were not setting the prefixlen

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-23 15:31:37 -04:00
Donald Sharp
4bf6638636 Merge remote-tracking branch 'origin/stable/3.0' 2017-05-19 08:09:42 -04:00
David Lamparter
be1f2d1802 Merge pull request #586 from donaldsharp/msdp_crashalicious
pimd: Fix crash from cli missinterpertation
2017-05-19 13:38:48 +02:00
Donald Sharp
53c438dae2 pimd: Fix crash from cli missinterpertation
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18 23:06:12 -04:00
Chirag Shah
ee22bbae78 pimd: Fix to Tx S,G Join when SGRpt->Join state
-Upon Rx (*,G) Join w/o SGRpt at RP, trigger (S,G) Join
towards FHR, unset SGRpt flag from channel,
add (*,G) oif to (S,G) entry.
-Add I am not RP check to triger SGRpt on *,G path otherwise,
send S,G Prune on SPT path from RP to FHR upon receving *,G Prune.
-Upon Rx SGRpt receive, remove OIF(downstream where Prune received) from specific S,G.

Testing Done:
pim-smoke
Ran 95 tests in 11790.552s
FAILED (SKIP=10, failures=4)

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-18 14:36:25 -07:00
Donald Sharp
ac139b5fb6 Merge remote-tracking branch 'origin/master' into pim_crash_a_boo 2017-05-18 09:45:57 -04:00
Donald Sharp
25c58d6d2b pimd: Address PR Comments
Remove a bit more dead code and unused variable.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18 09:44:09 -04:00
Donald Sharp
69b174d4ec pimd: Fix indentation issue that is causing clang unhappiness
The indentation of ifjoin_to_noinfo was not consistent with
the rest of the function and caused clang to loose it's mind

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18 09:03:58 -04:00
Donald Sharp
f1deac618b pimd: Fix indentation issue that is causing clang unhappiness
The indentation of ifjoin_to_noinfo was not consistent with
the rest of the function and caused clang to loose it's mind

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18 08:56:40 -04:00
David Lamparter
57463530f3 Merge branch 'stable/3.0'
Conflicts:
	ospf6d/ospf6_lsa.c
	ospfd/ospf_vty.c
	zebra/interface.c

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 12:28:12 +02:00
David Lamparter
303f85d545 Merge branch 'frr/pull/548' ("Pim dev 3.0 defect fixes")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 11:34:50 +02:00
Chirag Shah
ba4eb1bccf pimd: pim bfd support
All PIM Neighbors for a given pim interface is registered with
BFD.
Upon receiving BFD status down event, PIM Neighbor with BFD info is deleted.
Add pim bfd configuraiton (CLI) per interface, '[no] ip pim bfd'

Testing Done:
Configure BFD under PIM interface on all neighbor routers,
check bfd sessions up, remote end unconfigure BFD, results in BFD session down.
Previous state was UP to New state DOWN, results in PIM neighbor delete behind
that particular pim interface.
Pim-smoke Results:
Ran 94 tests in 7409.680s
FAILED (SKIP=8, failures=2)

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-17 22:42:28 -07:00
Donald Sharp
4a07939b68 pimd: Thread changes allow pim to crash a boo
When we add a thread pointer to thread_add_XXX functions
when the specified function is called, thread.c is setting
the thread pointer to NULL.  This was causing pim to
liberally pull it's zassert grenade pin's.

Additionally clean up code to not set the NULL pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-17 20:33:43 -04:00
David Lamparter
bac7b7b935 Merge pull request #537 from donaldsharp/vrf_stuff
Vrf stuff
2017-05-17 22:06:39 +02:00
Renato Westphal
e89f016d3e Merge pull request #561 from donaldsharp/static_config2
Static config2
2017-05-17 14:18:51 -03:00
Donald Sharp
934ec54171 Merge remote-tracking branch 'origin/stable/3.0' 2017-05-17 08:51:25 -04:00
Donald Sharp
d5f4ab97a6 pimd: Fix spelling mistake in cli
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-17 07:51:23 -04:00
Chirag Shah
95d3f5011b pimd: Fix input value to bool
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-16 22:02:41 -07:00
Chirag Shah
8dc60b69b5 pimd: fix pim reg processing return 1 upon success
pim register_recv api returns 1 instead of 0 upon succesfully processing REG message

Testing Done:
Verified At RP via receiving PIM (Data/Null) Register messages
and checked show ip pim interface < > Received errors under Hello

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-16 19:31:06 -07:00
Chirag Shah
30cfe9a291 pimd: fix ip pim hello option does not take in effect
If frr.conf file has pim hello option setup prior to pim sm under an interface, upon frr start/restart hello option cli replayed prior to sm command
from vtysh. Added a code in pim hello option cli handler to create pim vif if it does not exist.

Testing Done:
configure pim hello options before pim sm in frr.conf file and restart frr

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-16 19:30:14 -07:00
Chirag Shah
a91ec03e11 pimd: IGMP Query Tx when Oth. Querier exp
Send IGMP General Query and Get Gen. Query timer,
once Other Querier timer expired.

Ticket:CM-13152
Reviewed By:CCR-6189
Testing Done:
tor-4# show ip igmp interface
Interface  State          Address  V  Querier  Query Timer    Uptime
swp2          up         70.1.1.2  3    other     --:--:--  00:06:45
swp3          up         80.1.1.2  3    local     00:00:35  00:22:52

Upon disabling IGMP on remote igmp interface, after other querier expiry
sends a query and elects as Querier
tor-4# show ip igmp interface
Interface  State          Address  V  Querier  Query Timer    Uptime
swp2          up         70.1.1.2  3    local     00:01:29  00:10:16
swp3          up         80.1.1.2  3    local     00:01:14  00:26:23

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-16 10:23:00 -07:00
Chirag Shah
5578590086 pimd: Avoid deleting SGRpt entry from PP->P state
-Upon Receving SGRpt Prune message, transitioning from Prune Pending state
to NOINFO state, ifchannel entry was getting deleted in prune pending timer
expiry. This can result in SGRpt ifhchannel deleted and recreated upon receving
triggered or periodic SGRpt received from downstream.
The automation test failed as it expected (check) SGRpt entry at RP after it triggers
SPT switchover.

- While transitioning from Prune-Pending state to NOINFO(Pruned) state, Trigger
SGRpt message towards RP.

- Add/del some of the debug traces

Ticket:CM-16057
Reviewed By:CCR-6198
Testing Done:
Rerun test08 multiple times and observed passing it.

Pim-smoke with hardnode
Ran 95 tests in 11219.420s
FAILED (SKIP=10, failures=4)

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-05-16 10:18:29 -07:00
Donald Sharp
76ca2fbaa2 pimd: Fix core from json static mroute show
When we have no normal mroutes and only static mroutes
there exists a code path where we attempted to dereference
c_oil when we were showing static mroutes.  Looks like
a cut-n-paste error, we should be using s_route->c_oil there

Ticket: CM-15013
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-16 13:01:14 -04:00
Donald Sharp
6df8536487 *: Consolidate vrf_hooks into vrf_init
We only needed to add/change the vrf callbacks when we initialize
the vrf subsystem.  As such it is not necessary to handle the callbacks
in any other way than through the init function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-15 19:31:27 -04:00
Donald Sharp
759927a1b9 *: Remove some unneeded functions
vrf_iflist_create -> By the time this is called in enable, the vrf's iflist
is already created.  Additionally this code should be a properly of the vrf
to init/destroy not someone else.

vrf_iflist_terminate -> This function should be a property of vrf deletion
and does not need to be exposed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-15 19:11:20 -04:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)

Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 16:37:41 +02:00
Quentin Young
66e78ae64b *: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See
previous commit message.

To ensure that the behavior stays functionally correct, any assignments
with the result of a thread_add* function have been transformed to set
the pointer to null before passing it. These can be removed wherever the
pointer is known to already be null.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-09 20:44:22 +00:00