Commit Graph

1048 Commits

Author SHA1 Message Date
Donald Sharp
48d331e7dd pimd: Clean up rpf_hash *after* upstream cleanup
Cleanup the pim->rpf_hash after upstream cleanup is done
since upstream cleanup uses the rpf_hash to cleanup itself.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-11 18:39:09 -04:00
Donald Sharp
26bb1fd528 pimd: Allow interface to move in and out of vrfs
When we get an interface move event track the correct
pim instance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-11 18:38:01 -04:00
Donald Sharp
399495806c pimd: Cleanup all pim_ifp pointers on termination
Properly cleanup pim_ifp pointers on termination

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-11 18:36:24 -04:00
Donald Sharp
7692c5ae82 pimd: Cleanup ifchannel deletion
When we are being told to go away, cleanup ifchannel deletion
a bit better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-11 18:36:24 -04:00
Donald Sharp
845d9af76a pimd: Cleanup msdp shutdown
Shutdown pim msdp code a bit better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-11 18:36:24 -04:00
Donald Sharp
172e45dc30 pimd: Cleanup the deletion event a tiny bit
The pim_upstream_free command was leaving slag by
not deleting data associated with the upstream
data structure.  Modify the code to explicitly free
all data associated with an upstream on a pim instance
deletion event.  Additionally the end result is that
the pim_upstream_free command is not needed anymore

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-11 18:36:24 -04:00
Mladen Sablic
21313cbfda pimd: show ip igmp statistics command
Command showing IGMP Rx statistics, useful for analyzing IGMP
activity on interfaces.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-05-04 17:05:19 +02:00
Jafar Al-Gharaibeh
31569f0bbc
Merge pull request #2159 from donaldsharp/msdp_crash
pimd: Fix some msdp crashes when some fundamentals change
2018-05-03 09:40:23 -05:00
Donald Sharp
ec2f0e53c4 pimd: Fix some msdp crashes when some fundamentals change
When the underlying networking subsystem is fundamentally
changed via some system controls.  If we have msdp running
there exists a possibility that we need to stop some running
timers to prevent a crash.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-01 23:40:26 -04:00
Donald Sharp
e55a43d491 pimd: Remove expensive lookup for if a device is a vrf device
Interfaces know if they are a vrf device or not and this data
is passed up to the protocol.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-30 07:56:24 -04:00
Donald Sharp
7f432a28e0 pimd: Cleanup pim_if_is_loopback
The interface itself knows if it is a vrf device or
not, so let's just use a check for that in the decision
if a interface is a loopback or not.

Additionally modify function to return a bool.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-30 07:53:01 -04:00
Mladen Sablic
71e55fb257 pimd: adding querying of state to mtrace
Adding to mtracebis querying with group address. Same change
to vtysh mtrace command. Support for querying (S,G) and (*,G)
state in mtrace router code. Further improvments to mtrace router
code with closer complience to IETF draft. More references in
comments to the draft. Man page has been updated accordingly.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-04-24 18:47:50 +02:00
Quentin Young
25521d49a7 pimd: avoid writing to negative fd
Coverty #1465483

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Quentin Young
ef7eec745d
bgpd, pim: remove undebug
This 'undebug' syntax is only used in 5 commands and serves no apparent
purpose.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-02 16:03:11 -04:00
Lou Berger
97610b589f
Merge pull request #1921 from donaldsharp/pim_stuff
Pim stuff
2018-03-30 12:03:33 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Renato Westphal
73b3323c37
Merge pull request #1957 from qlyoung/fix-mtrace-unaligned-pointer-access
pimd: fix unaligned pointer access
2018-03-23 12:33:11 -03:00
Donald Sharp
33762ff980
Merge pull request #1931 from msablic/pim_mtrace_router
pimd: mtrace router code improvments and fixes
2018-03-22 18:41:20 -04:00
Mladen Sablic
7fb82673ca pimd: mtrace router code improvments and fixes
Mtrace router code has been fixed for the case where no PIM
interface exists towards the source and next-hop is returned.

fwd_ttl is set to one, for correct reporting of mcast ttl.

Also, NO_MULTICAST error is returned when there is no PIM.

And prev_hop is set to source, for case when connected to source,
to help termination of hop-by-hop queries.

Dependency of logging on PIM, when sending mtrace packet, has been
removed.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-22 22:05:28 +01:00
Quentin Young
f75ecf8dc2
pimd: fix unaligned pointer access
Can't take the address of members of packed structures due to potential for
alignment faults on some platforms.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-22 13:33:20 -04:00
Donald Sharp
993b143225 pimd: Fix leaked fd and prevent null pointer deref
When the pim_nexthop_lookup fails, close the opened fd
as part of the failure condition.

Additionally pim_nexthop_lookup assumes that we've
actually already looked up a nexthop in the past.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-19 09:18:10 -04:00
Donald Sharp
bfc9201928 pimd: Move some data tracking variables per VRF
There were a few more global variables that needed to be per
vrf.  So move them over.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 21:34:55 -04:00
Donald Sharp
5d59e40841 pimd: make igmp_source_forward_reevaluate_all vrf aware
There is no need to look at all VRF's when we need to
reevaluate the source forward since the calling function
knows the vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 21:16:42 -04:00
Donald Sharp
da11e32521 pimd: Make the rpf scan per vrf.
We know the vrf that we are in when we need to initiate a
rescan of the rpf cache.  So pass it in and use that information.
This should help the rescan at scale with several vrf's cutting
out a lot of unnecessary work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 21:13:09 -04:00
Donald Sharp
78c16071f9 pimd: Just call the actual function
We do not really need a level of abstraction to call a particular function.
Just call it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 20:54:04 -04:00
Donald Sharp
46fe6fd557
Merge pull request #1885 from msablic/pim_mtrace_client
pimd: improvments to mtrace
2018-03-15 17:21:05 -04:00
Mladen Sablic
04a2eef368 pimd: improvments to mtrace
mtracebis has been updated, so it behaves more like the original
mtrace command.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-14 11:51:35 +01:00
Philippe Guibert
3bc34908e8 lib: privileges are granted to vty netns command
Vty commands that link netns context to a vrf is requiring some
privileges. The change consists in retrieving the privileges at the
vrf_cmd_init() called by the relevant daemon. Then use it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-03-13 16:32:58 +01:00
Mladen Sablic
f83f396624 pimd: mtrace only IGMP sockets
Feature of mtrace only IGMP sockets on pim sm and pim
ssm interfaces. Modifed IGMP socket creation and show
igmp interface command output.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-08 09:40:48 +01:00
Lou Berger
3a6351a3d9 pimd: another change to keep indent.py happy
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:09:19 -05:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Donald Sharp
95d962bf1d pimd: Cleanup TODO file
The TODO file had become a dumping ground of changes made
to the protocol.  That when we modified the underlying code
we would need to update the TODO file again due to it's nature.

There is no point in keeping the list of items that we've done
as that commit messages will indicate the new features.  So
pull out all the Finished work and rework the Todo numbers
used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-26 21:33:02 -05:00
Donald Sharp
4e8b02f4df *: Rename ZEBRA_FLAG_INTERNAL -> ZEBRA_FLAG_ALLOW_RECURSION
The ZEBRA_FLAG_INTERNAL flag is used to signal to zebra that
the route being added, the nexthops for it can be recursively
resolved.  This name keeps throwing me off when I read it
so let's rename to something that allows the developer to
understand what is going on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-26 21:26:33 -05:00
Donald Sharp
f9159fbc10
Merge pull request #1804 from msablic/pim_mtrace_doc
pimd: added mtrace caveat
2018-02-27 08:10:43 -05:00
Mladen Sablic
11d3c0c3f6 pimd: added mtrace caveat
Added mtrace caveat to CAVEATS.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-02-27 14:03:39 +01:00
Donald Sharp
55cd0f612a *: Make assignment from RB_ROOT in while loop work better
Fix up the assignment of the variable = RB_ROOT inside of
while loop patter we were using.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-23 07:08:36 -05:00
Donald Sharp
5b02bd3ad0 pimd: Fix some compiler issues
Fix some compiler issues that were not picked up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-23 02:07:47 -05:00
Mladen Sablic
4d9ad5dcd0 pimd: Multicast traceroute client and router
This commit is the implementation of weak multicast traceroute.
It consists of IGMP module dealing with mtrace type IGMP messages
and client program mtrace/mtracebis for initiating mtrace queries.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-02-19 23:13:55 +01:00
Donald Sharp
7d30a95973 bgpd, pimd: Handle return code for nexthop_decode
Appropriately handle the return code for the
zapi_nexthop_update_decode call.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-05 08:34:47 -05:00
Donald Sharp
4a749e2cb2 bgpd, lib, pimd: Make nexthop_update decoding common
Create a zapi_nexthop_update_decode function that both
pim and bgp use to decode the message from zebra.

There probably could be further optimizations but I opted
to keep the code as similiar as is possible between the
originals because they both make some assumptions about
code flow that I do not fully understand yet.

The real goal here is that I want to create a new
user of the nexthop tracking code from a higher level
daemon and I see no need to re-implement this damn
code again for a 3rd time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-05 03:44:29 -05:00
Donald Sharp
57dac17c57 lib, pimd: Remove PIM_NODE as it is not needed
The PIM_NODE command is only being used to display
default vrf configuration.  Move this into the
vrf display and remove PIM_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-30 03:21:42 -05:00
Donald Sharp
3c19254068 bgpd, lib, pimd: Abstract commands for nexthop tracking
Abstract the code that sends the zapi message into zebra
for the turn on/off of nexthop tracking for a prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-22 19:45:31 -05:00
Donald Sharp
daeda3d7ff pimd: No need to assert on the redist_default
zclient_init sets the redist_default to the appropriate
value, testing it with an assert doesn't really provide
us with much of anything useful.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-22 19:44:52 -05:00
Philippe Guibert
87ad28f48c pim: fix compilation issue with pim
The change of vrf_id_t from 16 bit to 32 bit needs some changes in pim
daemon.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-01-22 13:52:24 +01:00
Donald Sharp
23f1c68bb2 pimd: Allow use-source to return more subtle error codes
The 'ip pim use-source ...' command returns a hard
success/failure.  Allow it to return a soft-failure
for when we re-enter the same line.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-08 16:01:22 -05:00
Donald Sharp
01841ed3a7 pimd: Add finer grain return codes for configuration
When PIM handles some MSDP commands, a repeated command
was causing a CMD_WARNING_CONFIG_FAILED.  This should
be a CMD_WARNING.  Fix the code to allow vtysh to handle
this appropriately.

Ticket: CM-19053
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-03 09:06:44 -05:00
Jafar Al-Gharaibeh
97c772b30b
Merge pull request #1543 from donaldsharp/pim_sg_rpt
pimd: Really, Actually send S,G rpt prune upstream
2017-12-19 09:29:44 -06:00
Donald Sharp
b8ca17c230 pimd: Fix memory allocation error
When creating the pim_ifp, and we run out of memory there
existed a chance that we would dereference the failed memory
pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-14 10:43:53 -05:00
Donald Sharp
b456bceb4a pimd: Really, Actually send S,G rpt prune upstream
When we receive a S,G rpt prune message for a mroute,
really, absolutely, guarantee the send upstream immediately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-12 20:29:38 -05:00
Quentin Young
2d34fb80b8
*: don't use deprecated stream.h macros
Some of the deprecated stream.h macros see such little use that we may
as well just remove them and use the non-deprecated macros.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-12-01 13:51:06 -05:00