There exists situations where we may have cleaned not
properly cleaned up the various J/P aggregation lists.
This commit fixes those issues.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Contains the fetch-and-run-thread logic, and vty startup (which is the
last thing happening before entering the main loop).
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Centralise read_config/daemonize/dryrun/pidfile/vty_serv into libfrr.
This also makes multi-instance pid/config handling available as part of
the library. It's only wired up in ospfd, but the code is in lib/.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Start centralising startup & option parsing into the library.
FRR_DAEMON_INFO is a bit weird, but it will become useful later (e.g.
for killing the ZLOG_* enum, and having the daemon name available)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
The 'show ip pim state' command was not
working quite correctly from when
we moved over to the new vtysh-grammar.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Automatically turn on pim if the daemon is turned on.
Hide the 'ip multicast-routing' command
Disable the 'no ip multicast-routing' command
Do not display the 'ip multicast-routing' command.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When you enter these commands, under an interface:
ip igmp version ...
ip igmp query-interval ...
ip igmp query-max-response-time ...
ip igmp query-max-response-time-dsec ...
These commands will now just turn on igmp for the
interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add the ability for PIM to send Join/Prunes as an
aggregated message instead of individual messages
for each S,G.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The static mroutes were making the assumption that the vif index
and the ifindex were the same. This is not necessarily the case.
Additionally if we are displaying a *,G route only display
the G.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a group in a IGMP report
let's look it up based upon a hash
instead of a list.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Suppose we have this
(*,G) IIF = swp1 OIL: swp3
(S,G) IIF = swp2 OIL: swp3 swp4
There exists situations where we can receive the mcast
packet for (S,G) on both swp1 and swp2. In this case
the packet received on swp1 will be sent from the kernel
to us as a WRVIF and WRVIFWHOLE.
As per normal, WRVIF packet processing handles the assert
case so we know we have not received the packet on a downstream
interface, so no assert.
The WRVIFWHOLE packet processing can then check to see if
it received the packet as a result of the (*,G) mroute
from upstream. If we have then we can safely drop
the packet.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we are at scale, it is possible that
we have a very large number of ifchannels
per interface. So make lookup for
that situation to be a hash lookup.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we are only looking at one ifchannel, for inheritance, narrow
the search down to only the interface/ifchannel we are interested in
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a igmp packet, there is no need
to ensure that it is a igmp packet, as that is
what we have asked for.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we get a packet from the network for pim, we do not
need to check to see that it is a pim packet, since that
is what we've asked to receive.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When receiving a J/P packet, only check to see if we should
log when the J/P packet is not for us.
Very slight performance improvement additionally
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pim_upstream_join_timer_decrease_to_t_override passed in
a `struct in_addr` that in all cases was part of the
upstream data structure that was passed in already.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Switch pim over to using packed data structures for building
Join/Prune messages to be sent.
This is a pre-cursor to the ability to handle the ability
to aggregate Join/Prune messages together.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
For:
pim_msg_build_header
pim_msg_addr_encode_ipv4_ucast
pim_msg_addr_encode_ipv4_group
pim_msg_addr_encode_ipv4_source
Assume that the buffer size passed in is of sufficient size
already. This is assured already because buffer sizes
are checked for minimum lengths for the entire packet
ahead of time. So we are double checking.
Additionally at scale we will be calling these functions
a very very large number of times.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add the 'struct pim_msg_header' and convert
all places that encoded/decoded the message header
to use it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Document the J/P packet format and ensure
that the smallest size packet that we
may send will actually fit.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Convert the const int size of the encoded
types to #defines so that they can be
used elsewhere.
Return Null instead of 0.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14652
Testing Done: Tested via sending IGMP report and flap port and verified pim upstream and mroute, the entry is deleted. Run pim-smoke
Even after Report received port down event, IGMP entry alawys exists in upstream, mroute, kernel.
The entry exist because it was recreated after delete due missing check if group has no more source list,
mode is exclude, last source address was * means (*, G) so do not trigger to create entry.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket:CM-14056
Reviewed By:sharpd, CCR-5603
Testing Done: verified multiple ifdown/ifup event on submitter setup and dev setup with 2k s,g entries, ran pim-smoke.
1. during ifdown event, pim vif for bridge was not resetting vif_index to -1 due to errno received from
kernel during vif del sequence. It could be timing issue where kernel may have delete prior to pimd sending request.
For vif_del even kernel returns error, reset vif_index to -1 in pimd DB so next if up event VIF receives new vif_index
and reprograms in kernel.
2. during mroute del sequence reset mfcc_parent to MAXVIF.
3. during mroute add check if parent mfcc_parent is MAXVIF then do not download to kernel such mroute entry.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Ticket:CM-12924
Reviewed By:shapd
Testing Done: configure PIM neighbor, verify PIM hello packet dump for ttl to be 1.
Set TTL to 1 for outgoing multicast control packets destine to ALL-PIM-ROUTERS as oppose to unicast mcast packets.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Ticket: CM-12041
Reviewed By: sharpd, CCR-5556
Testing Done: Tested on Local setup generating PIM Register (Data/Null) and processing both Tx/Rx with correct checksum.
Provided quagga debian to submitter and checksum cases passed on submitter setup.
1. PIM Register msg checksum only accounts for 8 bytes (4 bytes for PIM header and next 4 byetes before data payload).
In PIM header checksum calculation checked PIM packet type (in this case REGISTER type) then only pass 8 bytes as length
rather than full packet length.
2. PIM Register Rx path also handled with 8 byte and full pim lenth checksum.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Ticket: CM-13771
Reviewed By: CCR-5537
Testing Done: yes
Fix to CM-13771 where DBG message was out of order.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Cleanup the in_ifname and out_ifname buffers
to be large enough to hold the actual interface
names.
Additionally move the common variables to be defined
once, instead of inside of multiple for loops
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
In all cases pim_sock_open was called, we just passed
in the pim_ifp->primary_address, which is accessible
from the interface pointer. So just pass that in.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This fixes the issue a crash when we have configured an interface
inside of a vrf, and apply pim commands to it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The library libzebra that is installed with FRR will
conflict with Quagga. So let's rename it to libfrr.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Fix broken switch statement that would
allow the case statement to fall through.
Fix possible buffer overwrite.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When on the RP we received a prune *,G for an established S,G
If join_desired is no longer true we need to prune and
reset some timers, in addition to removing the inherited
interface from the olist.
This was not happening because we were just removing
the inherited oif from the *,G.
Ticket: CM-14561
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Valgrind noticed that we have a read of uninitialized memory:
Conditional jump or move depends on uninitialised value(s)
==13749== at 0x428067: pim_ifassert_winner_set (pim_assert.c:57)
==13749== by 0x4266F0: pim_ifchannel_add (pim_ifchannel.c:535)
==13749== by 0x426CC1: pim_ifchannel_join_add (pim_ifchannel.c:730)
==13749== by 0x427B5B: recv_join (pim_join.c:95)
==13749== by 0x427B5B: pim_joinprune_recv (pim_join.c:270)
==13749== by 0x42354F: pim_pim_packet (pim_pim.c:249)
==13749== by 0x4236C0: pim_sock_read (pim_pim.c:349)
==13749== by 0x4E60587: thread_call (thread.c:1462)
==13749== by 0x40C75E: main (pim_main.c:266)
==13749==
This commit fixes that issue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We were creating the pimreg device with a
created ifindex of 255. This was causing
issues when a interface was assigned a ifindex
of 255 by the kernel. Subsuquently pim
would stay in a hosed up state.
Modify the ifindex used for the pimreg device
to be 0.
Ticket: CM-14625
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we are creating the igmp ifchannel we were creating
it with both a P and a I flag. This was causing
it to not be cleaned up properly when the interface
was shut down. Subsuquently when the interface
came back up we would attempt to add it back in
but it would fail.
Ticket: CM-14586
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
PIM was handling vif creation deletion poorly
for interface down and up events. Fix this
issue by keeping track of which vif index'es
we have issued and allow the wholes to be
filled in.
Ticket: CM-14556
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit does these three things:
1) Add code to 'show ip pim state' to show where OIF's got their
decision to include that interface
2) Add code in pim_mroute_[add|del] to display what we think we are
adding to the kernel
3) Add code to properly track where we got the incoming request from and
to appropriately not remove a OIL if we have state still
Ticket: CM-14034
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
Rename the qpim_zclient_update variable to zclient.
This is to follow the naming conventions in the rest
of the code.
Additionally move the struct zclient * pointer into pim_zebra.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Start the abstraction of the zclient data structure out from a
global variable for the entire program to a global variable
to the pim_zebra.c file.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We were adding the 'ip msdp ...' command to
the parser 2x. Some new code added to the
parser apparently catches this for us now.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The PIM_MRT and registration for WRVIFWHOLECACHE
is a bit of linux specific code. Until such
time that this gets implemented we will have
issues being able to work within the context
of PIM-SM.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
thread.c fails to build if we do not have CLOCK_MONOTONIC
no need to have pim have any knowledge of it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Mixing well-known and variable property names makes the output difficult
to parse. so wrapped variable-keyed dicts with well-known property
names (such as "oil") in the following outputs -
"show ip mroute json"
"show ip msdp mesh-group json"
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
When you bounce interfaces and the system is under heavy
load there exists situations where zebra may or may not
have told us the new ifindex, but we've requested a
nexthop lookup, which bypasses normal mechanisms for
zebra communication, we may get back a ifindex that
we may have not created a ifp for yet.
Ticket: CM-14052
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
When shutting down, actually delete the right data
structures.
Stupid cut-n-paste error on my part.
Ticket: CM-14018
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
There exists situations where we have noted that
we need to rescan but have missed the window
of opportunity to actually redo the scan
so for the moment allow the S,G 30 second
scanner notice the missed opportunity and
fix it. We'll remove this later.
Ticket: CM-13988
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Sending (S,G)RPT prune was causing issues due to not handling
it properly at this point in time. So just don't send it right now
Ticket: CM-13969
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When you do a series of ifdown/ifup for
an interface that is receiving packets
through the kernel pim socket, it is
possible that the interface has been
deleted but the kernel is still going
to deliver us a packet. In that case
do not allow us to crash.
Ticket: CM-13981
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Bridges and bonds when ifdowned are removed from
the kernel in it's entirety, while pim assumed
that interfaces were kept around in some fashion.
Basically when we had an ifdown event, for all ifchannels
on that interface delete from the OIF. Also note
the fact that the vif has gone away and we need to
recreate it on the next ifup.
Ticket: CM-13896
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we have network churn and we have an inherited_olist
notice when we may have a situation where we need
to recalculate the inherited_olist.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a packet from a neighbor, reset the
hold time as that we *know* that they are still
alive.
During heavy packet load, we were seeing cases
where neighbors were being reset because we
were timing out due to not processing the hello
packet in time.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we encounter an error in the state machine
for an individual ifchannel, do not bring the entirety
of the pim daemon down. Notice the issue and continue
on.
Ticket-CM-13939
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
In certain error conditions it is possible to
attempt to send packets when the socket is not ready
instead of dumping to the log a million error messages
only note the issue if we have packet debugs on.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Modify pim_usptream_new to auto create the pim
channel oil. Why? Because there exists situations
where we have upstream state and we are attempting
to set the inherited_olist on it and we have
not created the channel oil yet. When that
happens we end up with mroutes that are
being meanies.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
There exists situations where PIM stores a S,G channel oil
and doesn't delete it. When a new upstream comes in for
it we were not ensuring that the IIF for the S,G channel oil
was correct.
Ticket: CM-13908
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When debugging is turned on for 'debug mroute' we
are unable to tell when a mroute has been added
or deleted from the mrib. Notice when we
do it and who called it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
In the normal case when we have debugs turned on and the
stream is not running, only display one line of output
instead of 2.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Cleanup some pim debugs:
1) For some reason some PIM_DEBUG_PIM_TRACE were not showing up
switched them to PIM_DEBUG_TRACE
2) Some mroute debugs were a bit redundant. Reduce.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a new *,G ifchannel, handle the inherited_olist
for S,G mroutes in a place where it is more appropriate.
Ticket: CM-13892
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
When the switch in question is both a FHR and the RP
for the received multicast group stream. When we go
to send the NULL register to the RP( ourselves )
do not send it if we have not seen packets for
that stream in time greater than PIM_KEEPALIVE_PERIOD
and I_am_RP(G).
Ticket: CM-13880
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
12 is too slow of a slow-start in scale setup (say with 6000 SAs)
when sources are being learnt one at a time (but in a rapid fire
fashion).
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
If we were in the middle of a partial read when the tcp connection is
reset we were clearing the buffers but not the packet size. This can be
problematic when the connection is re-established.
There is no easy way to repro and test this without scale (and a timing
pattern that is hard to predict). So this change is mostly untested.
Ticket: CM-13852
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
When a group is in the 224.0.0.0/24 range and we
have igmp v2 turned on do not allow it to be
considered for inclusion as a mroute.
Ticket: CM-13855
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
So there exist conditions where we can start the Prune
Pending Timer and receive other packets that cause
us to not stop the pending timer. This was
due to a missread of the state machine.
Additionally when the prune pending timer pops and
we are not in prune pending state, note the fact
and move on with our life instead of crashing and burning
Ticket: CM-13851
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
This is done irrespective of the reason for del and is intended as a
catchall for cases (unclear which ones) where the RP can drop the SG
without KAT expiry.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
When we receive a invalid group( say outside of the 224/4
range) don't allow it to create state. Nicely reject
the rejectable.
Ticket: CM-13821
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
To avoid unnecessary ka activity in the network. When the SA
advertisment timer fires we build SA TLVs and send them to peers. As a
part of this tx we were also restarting the ka timer to avoid
unnecessary ka generation in the next 60 seconds. However because the
adv timer was restarted after tx (i.e. after ka restart) ka timer would
always endup firing just before the adv timer.
The entry_cnt in a SA TLV is one byte. I was trying to push 765 SAs into
each TLV resulting in strange problems in a scale setup.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
There exists conditions where PIM will have it's
upstream route removed and an unreachable route
is installed that points out the downstream
interface. This unreachable route is removed
from bgp as soon as it's path selection algorithim
works properly, but pim has already deleted
the oif and never puts it back in.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When issuing a vtysh -m command it expects the
output it receives to be the complete command
not a partial match.
The 'debug pim packets joins' command
was being outputted as 'debug pim packets join'
This was making quagga-reload.py unhappy. Adding
the joins word allows it to complete successfully
Ticket: CM-13805
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
There exists situations where an interface flaps
and routing recovers and we attempt to install
an upstream but since we have no neighbor out
that interface still. Let's cause the hello
to go out immediately for the 3.1 release
to allow mrouting to recover in this situation.
We will need to revisit this issue after
we have proper nexthop tracking in place
Ticket: CM-13185
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Make the 'ip igmp query-max-response-time' command
take input in deci-seconds and make the
'ip igmp query-max-response-time-dsec' command hidden.
Ticket:CM-13786
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
When debugging nexthops, we print allot of unnecessary data
Move some debugs to trace detail to reduce log clutter.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we add in or delete ip addresses from an interface
we may need to rescan the rp's that we know of to make
sure that they are still available.
Ticket: CM-12623
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
When a new rp is entered, pim is looking at all rp's and failing the check if
any of the RP's have no path to the RP, instead of the one that was
just entered being wrong.
Ticket: CM-12623
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
When we modify the 224.0.0.0/4 rp address with a:
'ip pim rp A.B.C.D'
We need to let msdp know that this command was entered.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
When we get a new neighbor for an interface, we need
to send a hello out that interface in some situations.
At this time we were tracking this by the pim_ifstat_hello_sent
value but not reseting it when we received a new neighbor.
Ticket: CM-13769
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Was failing with a vague error -
"Source set failed"
Changed to used the error string (used by the rest of the commands) -
"Pim not enabled on this interface"
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Currently the mroute-IIF and upstream RPF-IIF/neigh are resolved separately.
This must change i.e. be merged together for a couple of reasons -
1. In the case of ECMP we will use a load-share mechanism (based on G or
SG) to pick an RPF neighbor in 3.2.1 (to use the load-sharing cap of
anycast-RP). Using a different resolution mechanism for mroute-IIF will
simply not work.
2. In a non-CLOS topology it is actually possible to have routers that
do not participate in PIM. In this case the tree will be set up using
different routers than the ones chosen for the mroute IIF. And traffic
will not be forwarded.
This change is however too big for 3.2.0. So to handle CM-13714 I have
simply forced rpf update on neigh add which fixes the specific problem
seen on link flap in a clos (it is not very efficient but traffic
recovers).
In problem state -
(jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# ip mr
(0.0.0.0, 225.1.1.1) Iif: lo Oifs: swp3 lo
(20.0.11.253, 225.1.1.1) Iif: swp1 Oifs: swp3
(jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# vtysh -c
"show ip pim upstream"
Iif Source Group State Uptime JoinTimer
RSTimer KATimer RefCnt
lo * 225.1.1.1 Joined 00:08:44 00:00:15
--:--:-- --:--:-- 1
swp2 20.0.11.253 225.1.1.1 Joined 00:08:35 00:00:56
--:--:-- 00:02:59 1
(jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus#
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
When receiving a JOIN/PRUNE message if we have trace
turned on we output this:
2016/11/28 17:11:46.368827 PIM: pim_socket_recvfromto: HAVE_IP_PKTINFO to=224.0.0.13,103
2016/11/28 17:11:46.368956 PIM: Recv PIM JOINPRUNE packet from 169.254.0.6 to 224.0.0.13 on swp31s1: ttl=255 pim_version=2 pim_msg_size=34 checksum=e623
2016/11/28 17:11:46.369003 PIM: pim_joinprune_recv: from 169.254.0.6 on swp31s1
2016/11/28 17:11:46.369053 PIM: recv_prune: prune (S,G)=(20.0.11.253,229.1.2.3) rpt=0 wc=0 upstream=169.254.0.5 holdtime=210 from 169.254.0.6 on swp31s1
2016/11/28 17:11:46.369099 PIM: nonlocal_upstream: recv prune (S,G)=(20.0.11.253,229.1.2.3) to local upstream=169.254.0.5 on swp31s1
Clean up the messaging to this:
2016/11/28 17:11:46.368956 PIM: Recv PIM JOINPRUNE packet from 169.254.0.6 to 224.0.0.13 on swp31s1: ttl=255 pim_version=2 pim_msg_size=34 checksum=e623
2016/11/28 17:11:46.369053 PIM: recv_prune: prune (S,G)=(20.0.11.253,229.1.2.3) rpt=0 wc=0 upstream=169.254.0.5 holdtime=210 from 169.254.0.6 on swp31s1
Ticket: CM-13752
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
When a nexthop lookup is done we can get an ECMP output. But not all
nexthops are pim neighbors. If for this reason PIM chose a nexthop other
than the first the rpf info was not being set correctly i.e.
nexthop ip was still the one associated with the first path but
interface was set to the one associated with second path.
This problem is seen on a link flap in the CLOS topology.
Ticket: CM-13714
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
The RP address in the SA is only for informational/display purposes. It
is still confusing if we show a stale value.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
With the change over to using the kernel upcall for igmp messages,
we need to add in a read thread for the igmp socket to drain
the igmp socket's receive queue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Anycast rp requires multiple ip addresses on the lo. If PIM is used in
an unnumbered BGP network it picks one of the lo addresses as the
pim-primary for the swp interfaces. But if the anycast IP is picked up
by both sides pim nbr will never converge. So a static "use-source" config
is provided to allow the administrator to force the the hello source to the
unique IP address.
Sample output:
=============
dell-s6000-04(config-if)# do show running-config pimd
>>>>>> SNIPPED >>>>>>>>>>>>>>>>>
interface lo
ip pim sm
ip pim use-source 100.1.1.5
!
>>>>>> SNIPPED >>>>>>>>>>>>>>>>>
dell-s6000-04(config-if)# do show ip pim interface lo
Interface : lo
State : up
Use Source : 100.1.1.5
Address : 100.1.1.5 (primary)
100.1.1.100
>>>>>> SNIPPED >>>>>>>>>>>>>>>>>
dell-s6000-04(config-if)# do show ip pim interface lo json
{
"lo":{
"name":"lo",
"state":"up",
"address":"100.1.1.5",
"index":1,
"lanDelayEnabled":true,
"useSource":"100.1.1.5",
"secondaryAddressList":[
"100.1.1.100"
],
>>>>>> SNIPPED >>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add 'ip pim packets <1-100>' command.
Allows you to control the number of packets read in before
giving control back to another part of the process.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Anycast requires that the lo interface be associated with multiple
addresses. One is the anycast IP address (which is the same on all RPs
participating in RP redundancy) and the second is the unique IP address
that will be used as the router id by routing protocols.
To accomodate that we maintain a list of secondary addresses per-pim iface
and allow any of them to be the RP address. This lets the I_am_RP macro
succeed on anycast RPs.
Note that the support is limited i.e. we don't actually advertise a
secondary list to the neighbors. This is assuming the anycast IP will never
be used as a router id i.e. will never be an RPF neighbor.
Sample output:
==============
dell-s6000-04# sh ip pim interface lo
Interface : lo
State : up
Address : 100.1.1.1 (primary)
100.1.1.2
100.1.1.3
100.1.2.1
>>>>>>> SNIP >>>>>>>>>>>>>>>
dell-s6000-04# sh ip pim interface lo json
{
"lo":{
"name":"lo",
"state":"up",
"address":"100.1.1.1",
"index":1,
"lanDelayEnabled":true,
"secondaryAddressList":[
"100.1.1.2",
"100.1.1.3",
"100.1.2.1"
],
>>>>>>> SNIP >>>>>>>>>>>>>>>
dell-s6000-04#sh ip pim rp-info
RP address group/prefix-list OIF I am RP
100.1.2.1 224.0.0.0/4 lo yes
dell-s6000-04#
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
There exists situations where we can receive data
faster than we can process it. Make the buffer
large enough to catch these situations for
the pim sockets.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Modify mroute_read to be non-blocking and
then to read in up to 3 packets at a time
to be handled.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we received a packet we were dumping packet information
with debugs on 2 times for each packet where we had overlapping
data being passed.
Since debugs are expensive, reduce the count to 1.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Debugs are extremely expensive currently. Let's
store 'struct prefix_sg sg' string format in
the ifchannel, upstream and msdp_sa structures.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Cleanup some turned on debug code that is no longer
needed to be turned on in the pim_sock_read
code path.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Give ourselves a few more seconds to wait for a response
for a NULL Register. This will benefit us under heavy
mroute churn on the RP.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1. This is needed to layout the MSDP macros for determining what SAs are
originated by a MSDP speaker.
2. We no longer let the kat timer expire on an active flow. Activity
counters/lastuse is polled via a wheel for every SG entry. If new
activity is detected the keepalive timer is started and SPT bit set.
A SRC_STREAM reference is also created for the entry if one doesn't
already exist.
3. If KAT actually expires it means the flow is no longer active. At
this point we stop advertising the SA to MSDP peers. We also pull
the SRC_STREAM reference (deleting the entry if there are no other
references).
PS: Checking counters on KAT expiry will come in the next change.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
We are receiving notifications from the linux
kernel that we are filling up the receive buffer
for upcalls into pimd. Let's increase the size
to something a bit bigger.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add the 'ip pim register-suppress-time ...' command.
Remove the 'no ip pim rp keep-al...' command as
that the register suppress set that value.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Use the NULL c symbol to signify that we are
intentionally setting the pointer to NULL
instead of 0.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
If you specified the 'ip pim rp ...' after the
system has been configured it was not accepting
the new rp. This fixes that issue.
Ticket:CM-12623
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a 'no ip pim sm' for an interface
that has both pim and igmp on it, only turn
off pim.
Ticket: CM-12985
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a 'show ip pim rp-info' is issued shortly
after a restart/start, pim will crash because
nexthop information has not been fully resolved
and the outgoing interface is NULL.
Ticket: CM-13567
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1. Add support for mesh-group based configuration that is easy to apply
via automation. The older per-peer configuartion is temporarily hidden
and will be cleaned up later.
Sample config -
ip msdp mesh-group cumulus source 100.1.1.4
ip msdp mesh-group cumulus member 100.1.1.5
ip msdp mesh-group cumulus member 100.1.1.6
2. Added support for detail peer and sa-cache displays. Along with
filter keys.
3. Add json output for all the msdp displays.
With this commit basic support for anycast-RP with MSDP (in numbered
network is complete). Unnumbered support will be added separately.
Ticket: CM-13306
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
We've already allocated the mp data structure
and am using hash_alloc_intern for the hash_get
function. This will return the passed
in data structure. There is no possibility
of mp being NULL.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We need to react to route changes/Interface up/down events
faster in PIM. Reduce the timer down to 50ms.
Ticket:CM-13549
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we get a callback for a specific (S,G) and
we have no ifchannel for it, see if we have a
(*,G) channel and handle it appropriately.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1. Added a new MSDP source reference flag for creating (S,G) entries
based on the SA-cache. The RFC recommends treating as SA like rxing
a (S, G) join (which is a bit different then treating like a traffic
stream).
2. SA-SPT is only setup if we are RP for the group and a corresponding
(*,G) exists with a non-empty OIL.
3. When an SA is moved we need to let the SPT live if it is active (this
change will come in a subsequent CL).
Testing done:
1. SA first; SPT setup whenever (*, G) comes around.
2. (*, G) first. As soon as SA is added SPT is setup.
3. (*, G) del with valid SA entries around.
Ticket: CM-13306
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
When determining the inherited_olist(S,G) add
the determination that we have received a
prune(S,G,rpt) from a neighbor.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add some more code to handle the prune(S,G) with the
sptbit set. Turns this ifchannel into a (S,G,rpt).
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When leaving a channel, there exists a possibility
that we have not created the channel oil yet.
Ensure that we have channel oil before dereferencing
Ticket: CM-13522
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we handle the thread arguments,
there is no need to assert. As that
if they are wrong, we are going down
shortly anyways.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
According to Figure 5( Downstream per-interface (S,G,rpt)
state when we receive a (*,G) we need to move (S,G,rpt)
children of the (*,G) into different states. This
implements that.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we called pim_parse_addr_group, don't reinitialize
the 'struct prefix_sg' *after* we've parsed the group.
Ensure in other places that we do this work, we initialize
prior as well.
Ticket: CM-13510
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we have multiple incoming joins for
a single group on a interface, we need to
allow proper output.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
If you add to the json by grp, if you have multiple
ifchannels for that group, on the the first one will
be displayed.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don't delete the ifchannel if the expiry timer is still running.
We might need to add the prune pending timer as well? Not sure
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we read in the S,G from the join/prune message,
convert it into a 'struct prefix_sg' at an
earlier point in time.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Modify the pim_parse_addr_source function to take
a 'struct prefix_sg' and to fill in the src data.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Modify the pim_parse_addr_group to use 'struct prefix_sg sg'.
This is the first of 2 commits to clean up this parsing to
be a bit better.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add the ability for pim ifchannels *,G's to know their
corresponding S,G's. This will facilitate handling
S,G,rpt state information better.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit includes -
1. Maintaining SA cache with local and remote entries.
2. Local SA entries - there are two cases where we pick up these -
- We are RP and got a source-register from the FHR.
- We are RP and FHR and learnt a new directly connected source on a
DR interface.
3. Local entries are pushed to peers immediately on addition and
periodically. An immediate push is also done when peer session is
established.
4. Remote SA entries - from other peers in the mesh group and passed
peer-RPF checks.
5. Remote entries are aged out. No other way to del them
currently. In the future we may add a knob to flush entries on
peer-down.
Testing done -
Misc topologies with CL routers plus basic interop with another vendor (
we can process their SA updates and they ours).
Sample output -
root@rp:~# vtysh -c "show ip msdp sa"
Source Group RP Uptime
33.1.1.1 239.1.1.2 local 00:02:34
33.1.1.1 239.1.1.3 local 00:02:19
44.1.1.1 239.1.1.4 100.1.3.1 00:01:12
44.1.1.1 239.1.1.5 100.1.3.1 00:00:55
root@rp:~#
Ticket: CM-13306
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
This fix handles two issues:
1) Searching entire vrf_iflist to get per interface pim_ifchannel_list
2) Display of ifchannel information in pim not being ordered correctly.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a 'show ip pim join' is issued and we have
(S,G,rpt) being sent back up to us. We need
to order correctly for this situation.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we decide to ignore a incoming packet, allow detailed
debugging to give a pointer to where to go to understand the
issue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The (S,G,rpt) prune inclusion was incorrectly considering
if the RPF' was the same for (S,G) and (*,G).
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Do not reset the time the mroute has been in it's
current state if we get a transition to the same state.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add logic to show that we are making decisions about
the s,g,rpt prune send. We are not actually sending
anything yet.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
When outputting data about ifchannels due to debug
include the interface this is happening on.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
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>
If the incoming interface comes back, reinstall the channel oil
if the mroute is not installed.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
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>
When receiving callbacks from the kernel allow bigger
packet sizes than 3k to be handled appropriately.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
When a interface goes down we accidently put ourselves into
an infinite loop.
Ticket: CM-12803
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
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>
When a interface is configured as BGP unnumbered, it
has a v6 LL address as well as no v4 addresses. In
this case let's look at the lo's ip address as the
primary address to use.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
rebase
The recent conversion of in_addr_t to struct prefix
caused a display issue in the 'show run' of the rp.
Ticket: CM-12752
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The pim_find_primary_addr function just called 1 static function
that was called no where else.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Restructure code to remove SA warning from clang build.
For some reason, the Clang SA system thought that si.sin_port and
si.sin_addr where not being set to anything. Fix this problem.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When I converted over to using 'struct prefix'
I broke the initialization of the rp.
In addition, I used the wrong AFI type
to switch on in pim_rpf.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
mrib_nexthop_addr and rpf_addr should be 'struct prefix'
so that we can safely handle unnumbered data from a nexthop
lookup in zebra
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This is setup code to allow us to receive v6 addresses from
a nexthop lookup from zebra. This will allow us to work
with unnumbered interfaces.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
In the nexthop lookup routine, fix the duplicate code
to not check for too many indexes earlier.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Specify the ifindex of the interface that we want
to turn on IP_MULTICAST_IF on instead of the
address. If we pass in the address then the
fact that we have multiple interfaces with the
same ip address causes confusion in the kernel.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This has 2 fixes:
On nocache event, crate the channel oil first in
case we don't need to actually create the upstream
information
on wrvifwhole, create the channel oil and install
it, then only create the upstream information
if we are connected to the source.
Ticket: CM-12593
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
If a neighbor comes up *after* igmp joins and *after* all
the routes are installed into the kernel, then we never
go back and fix up the rpf cache information. So joins
never go out for those igmp joins.
Ticket: CM-12613
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The rpf debugs really should be zebra debugs
instead of trace debugs.
Additionally fix a return 0; to return NULL;
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The original modification to allow the RP to receive
packets on the incoming interface when it has
no outgoing interfaces was a bit aggressive and
turned all register events into a join event.
This further divides up the code to do the
right thing in each situation.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When starting up with a large # of streams
it is possible to have a timing where we
do not yet have a pim_ifp.
Ticket: CM-12636
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When installing a mroute on rpf change make sure
that we have oil for it at this time.
Ticket: CM-12636
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
If we receive a join for a upstream interface that hasn't
yet been added to pim for working under it, we never
go back and add the forwarding on when we get the
interface added to pim.
Ticket: CM-11800
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When the RP's address in PIM is not under the loopback,
we can have a situation where this causes PIM to crash.
Check for NULL pointers.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
List the RP information we have configured.
Fix bug where we were not properly initializing some code
Ticket: CM-12617
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
If on the FHR we have an established stream between
interested parties and we stop the stream and restart
quagga we were not coming back up into the correct
state. For the multicast stream.
Ticket: CM-12462
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When register stop was received but the upstream
creation fails we are not handling it properly.
Note and return.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Move the pim_mroute_conected_to_source function to pim_iface.c
because this is a interface question not a mroute question.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
On the RP when we receive a register packet for the
same interface that we received the *,G join on
allow the RP to receive the packets but to do
nothing with them.
Additionally check the last_used values even
if the ioctl fails.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When sending register packets to the RP from the FHR
we should be using the ip address of the incoming interface
that received the mcast packet.
Ticket: CM-12445
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This fix allows the RP to transition from a Prune'd to Join
state on reception of proper control messages.
Additionally it was noticed on if down -> if up transitions
the prune then join message was going out the wrong interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
I tried to be smart and skirt around rpf lookup if I knew
the incoming interface. This turns out to be not necessarily
a good thing because we can easily have asymetrical routing.
This fix removes the attempt to cache the ifp we received
the incoming packet on and just lets the lookup work like
it should.
Additionally it removes the weird hardcoding of the rpf
interface from the register stuff.
Ticket: CM-12530
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
reb
Ensure that when an upstream is removed that we actually
remove the route
Also when we get a callback for whole packet before
we send a register stop make sure we are actually on the
RP.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we are a FHR, and the upstream state is in Prune or Prune Pending
allow the join because we know we want to forward traffic to the RP.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Just pass in the actual state to allow us to translate
the state to a string even if we don't have a upstream.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When the Keep alive timer Pops stop the timer
and send a prune upstream if we need to
remove the state.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The RP needs to send the join when we want to send it
Also make sure the ka_timer is reset properly.
Ticket: CM-12473
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When there is allot of IGMP activity for the
kernel upcall that we are ignoring, just
ignore it for the moment as well.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When on a intermediate switch between the FHR and RP
when Quagga is restarted. Pimd is coming up so fast
and getting the S,G join before networking is properly
working on the switch. We would never install the
mroute in this case.
What was happening is that the scan of the S,G was
occurring and we were figuring out who we should talk
to but we were never installing the route for it.
Notice that we've never installed the route and install it
if the mroute has changed.
Ticket: CM-12460
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When the keep alive timer finds that we are no longer
sending packets for that particular S,G, remove
the upstream information but use the function that
makes sure we check the ref count.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a (*,G) route decide if we
need to cause any output interfaces to be
added to any S,G route associated.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When on the RP, if we receive the first correctly routed
mroute from upstream, Set the SPT bit so that the
state machine will work properly.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1) Ensure Timer is actually off
2) I missread the rfc, when we are in prune state, just send the
register stop. Do not add the tunnel device yet.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The RP was not properly handling the series of events:
1) When a WRVIFWHOLE is received if we are the RP,
send a pim register stop to the FHR.
2) When a register was received we were sending
a join (S,G) towards the S, then a immediate prune (S,G)
followed by another join (S,G). Just send the first join
3) Save whom we received the S,G register from so we
can use it later
4) Allow a join timer to restart itself instead
of causing a crash.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pim_zebra.c was checking to see if a ifp pointer was null
in some debug statements. This caused the SA code
to assume that if we were at this point then the ifp
could be null and subsuquent code that doesn't check
for it to be wrong.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
SA found these two issues:
1) Check of ifp non-null caused other non-checks down code
to assume ifp could be null. This is not the case.
If we get a callback at this point we must have a valid ifp pointer.
2) We were inadvertently calling igmp_source_reset_gmi with
a possible NULL source pointer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit addresses some SA issues found:
1) double set variables
2) value set but never used.
3) wrong return path used.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a new genid from a neighbor, we need
to form the neigbhor relationship before the join/prune
messages are sent to the neighbor.
Additionally we were calling the
pim_upstream_rpf_genid_changed function 2 times
in a row. This function just spun throught the upstream
list and marked all relevant upstreams to be sent
immediately
Ticket:CM-11979
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Allow the user to specify multiple rp commands.
'ip pim rp A.B.C.D' -> translates to 'ip pim rp A.G.C.D 224.0.0.0/24'
ip pim rp A.B.C.D A.B.C.D/M
First is the rp, second is the group with mask.
Groups and masks cannot be over each other except 224.0.0.0/24 which
is the fallback if used.
Ticket: CM-7860
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Refactor the qpim_rp into pim_rp.c so that the global data
is protected. This will allow us to easily add the group
ranges.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we are evaluating if we have a inherited_olist, include
the *,G state in determing what to do.
Additionally when we receive a join or prune of *,G
do the right thing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Fix the struct prefix to be an actual struct prefix_sg.
This cleans up a bunch of code to make it look nicer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
RFC 4601 4.5.7:
Joined
The downstream state machines and local membership information
indicate that the router should join the shortest-path tree for
this (S,G).
The code has a upstream state that is in 'J' state already
due to a S,G multicast packet received on an incoming
interface. This packet has been forwarded to the RP.
The RP sees this and immediately sends a join towards
the S,G.
The code as originally written assumed that you could
not transition from a J state to a J state. This is not
true.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The PIMREG ifchannel state is an evolutionary dead-end.
I should not have introduced this code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a NOCACHE upcall, add the pimreg interface
to the oil so that we can receive the data.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a *,G is received, and we have S,G that is in a
non-joined state, Send the join to the S,G.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We were erroneously sending a prune *,G immediately followed
by a join *,G under certain situations
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Each interface needs the ability to send raw packets
at the RP. Create the data structure to do so.
Further commits will create the socket as necessary
and send the packet.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Given a S,G ifchannel, create a parent pointer for any
*,G state for that interface. When removing a *,G
remove S,G pointers.
We need to think about the case where their is a *,G
but no S,G for a interface when we are determing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we call pim_str_sg_dump we cannot call the variable twice
for the same debug. This fixes this issue in the 2 places it
was borked.
Ticket: CM-12045
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a register is received, forward the packet as appropriate.
This is the infrastructure to make this happen.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a *,G report is sent, the RPT and WC bits
are set as well as the source is the RP address
for the group.
If this routers idea of the RP for this group is
different than the idea of the RP from the sender
than that particular *,G can be dropped.
Ticket: CM-12031
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The kernel upcalls for control messages should
be PIM_DEBUG_MROUTE instead of PIM_DEBUG_PIM_TRACE
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
For some reason Join/Prune debugs were being
turned on by trace not by the 'debug pim packets join'
command.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add some missing 'show debug pim' output so that I can
see what I think I'm debugging.
In general the pim debugs need another round of fixing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We were not correctly determing the inherited olist and
applying it to the s,g.
Start the work to do this.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we received a pim_register_recv we were shortcutting
the algorithm to determine what to do when we receive
a register pim message.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The pim_upstream_find function should not be finding a *,G
Find what is asked of it.
The switch_to_spt_desired should return true on the RP currently.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Convert more of the code to pass around a 'struct prefix sg'
instead of individual struct addr's.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Convert ifchannel to use a prefix to store (s,g) information.
Additionally create pim_str_sg_dump function to output
data when using debugs.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pim was sending the join from the RP towards the FHR with
a address that was the source instead of the nexthop. This join
was treated as a non-local and nothing was done with it.
Ticket: CM-11945
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a register for a (S,G) that we have no interest in
prune it off and send the register stop.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Allow pim_upstream_switch to be called from outside of pim_upstream.c
Also change the assert to an if test to just correctly stop the
timer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Change the pim message type to an enum and add the ability
to output a string based upon message type.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Implement the pim_register_stop state machine. There are still a few
bugs still but this is enough to get us rolling a bit more.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Remove the prune_echo function as that it just took some
data and passed it into another function.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a register stop is received, create the register stop
timer and associated state machine.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When sending a pim register message to an RP, we need
the ability to set the null bit in the message. This
adds the ability to do so.
Additionally we need to switch the ip_hdr to a const uint8_t *buf
because pim_register_send really shouldn't know or care about
the fact it's a 'struct ip'.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
For a given interface remove the interface from the list
of outgoing interfaces for a mroute and reinstall it
into the kernel.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a register stop we will have created a
timer for this. As such if the t_rs_timer pointer will
be non-NULL at this point.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We were using a variety of techniques to handle
incoming pim packets. Refactor to use a switch
statement to handle the incoming packets.
Also add the ability to notice that we are getting
a register stop.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The RP now has the ability to send a register stop message
to the originator of the packet in order to tell it to
stop encapsulating packets to the RP.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This replaces Quagga -> FRR in most configure.ac settings as well as
a handful of preprocessor macros in the source code.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This moves all install_element calls into the file where the DEFUNs are
located. This fixes several small related bugs:
- ospf6d wasn't installing a "no interface FOO" command
- zebra had a useless copy of "interface FOO"
- pimd's copy of "interface FOO" was not setting qobj_index, which means
"description LINE" commands would fail with an error
The next commit will do the actual act of making "foo_cmd" static.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
When displaying drpriority you can enter unsigned
integer values from 1-2^32. The display was
turning the unsigned value into a signed value
and thus we were displaying the wrong value.
Ticket: CM-13787
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: David Ahern <dsa@cumulusnetworks.com>
(cherry picked from commit db17265f1025e3ec578998ad537c33b49ed33cde)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Linux, FreeBSD and NetBSD (and possibly others too) accept both uint8_t
and int for the IP_MULTICAST_LOOP sockoption. OpenBSD, in the other hand,
accepts only uint8_t. To make setting IP_MULTICAST_LOOP work on every
supported platform, always pass a uint8_t variable as a parameter.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Since we have autoconf results from a wide swath of target platforms, we
can go remove checks that have the same result on all systems.
This also removes several "fallback" implementations of functions that,
at some point in the history, weren't available on all target platforms.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
original_s_route is allocated on the heap and was not freed during the
error case.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Consolidate the routemap initialization into one
function.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well. This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can
make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit
route-tags in the case of ripd,ripngd.
It is based on the following patch:
commit d25764028829a3a30cdbabe85f32408a63cccadf
Author: Paul Jakma <paul.jakma@hpe.com>
Date: Fri Jul 1 14:23:45 2016 +0100
*: Widen width of Zserv routing tag field.
But also contains the changes which make this actually useful for all
the daemons.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Since recently zebra uses only the ZEBRA_REDISTRIBUTE_* messages
to advertise redistributed routes to its clientes. Now the old
ZEBRA_IPV*_ROUTE_* messages are only used for client->zebra communication.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This is a rather large mechanical commit that splits up the memory types
defined in lib/memtypes.c and distributes them into *_memory.[ch] files
in the individual daemons.
The zebra change is slightly annoying because there is no nice place to
put the #include "zebra_memory.h" statement.
bgpd, ospf6d, isisd and some tests were reusing MTYPEs defined in the
library for its own use. This is bad practice and would break when the
memtype are made static.
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[CF: rebased for cmaster-next]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Move over to the new allocation counting added in the previous commit.
(This commit is mostly mechanical.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-12816
pim was missing route-map hooks
Use the 'enum nexthop_types_t' instead of
the zebra.h #defines. And remove code from
zebra.h that does not belong there.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
This effectively a partial revert of commit 61ea395...
"pimd: Bind pim sockets to interface they are associated with"
Note this isn't really a proper fix, it just clears the build breakage
on BSD without improving the usage of multiple sockets.
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
VIFF_USE_IFINDEX is not available on BSDs and other UNIX systems. In
order to build pimd on these platforms, use 'vifc_lcl_addr' instead of
'vifc_lcl_ifindex' to specify the interfaces we want to enable forwarding
of multicast traffic. In the case of unnumbered interfaces, print an
error and return.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
pim_igmp_join.c only exists to make some portability hacks available to
test_igmpv3_join. The function only has 1 call site in each pimd and
the test tool, so it's nicely served as a simple static function in a
header file.
This removes a MTYPE related compiler/linker issue from referencing
lib/if.h in a binary that doesn't link libzebra, as test_igmpv3_join is
now fully independent of lib/.
(Fix by Christian Franke: remove stray leftover ifindex_t)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This fixes compilation if the system libc doesn't have VIFF_USE_IFINDEX.
It'll still break runtime if the kernel is older than 2.6.32.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Some encode/decode functions are needed in multiple places.
Start the refactoring to be able to use them in a more generic
manner.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a kernel upcall happens for nocache we create
a (S,G) route to be installed into the kernel.
This code modification starts the ability to
time out the mroute if we stop receiving mcast
packets.
Ticket: CM-11793
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a multicast route's rpf changes( for whatever reason ) (*,G)
routes were never updating properly. This is because we were
attempting to fing the path to the *, instead of the RP.
Modify the code to check if we are attempting to find a
* route and use the RP instead.
Ticket: CM-11736
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Track whether or not if a mroute has been installed
or not. If not don't display information about it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The 'struct static_route' data structure duplicated a
decent bit of what is the in the struct channel_oil.
Refactor. This will set us up for further cleanup.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a toin IGMPv3 join is received, the code
was always auto creating the igmp group associated
with the received packet. The RFC clearly states
though that if a INCLUDE is received for a group
with 0 sources and we have received nothing the
igmpv3 packet should be ignored.
Ticket: CM-11260
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
After sending a IGMPv3 exclude report for a multicast address
with 0 sources, send an include report for the same group and also 0
sources. This should cause IGMP to GS query and age/delete
the entry.
This fix addresses this issue.
Ticket: CM-11685
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Added a default log file named /var/log/quagga/Quagga.log to every daemon
to capture log entries if no log file is defined. This also allows the
capture of logged information prior to reading each daemon's config file.
If a log file is defined manually, it will override this default file name.
Ticket: CM-10987
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing
Static joins were killed by a previous commit, which
has been backed out. I've recoded the igmp join
code to ignore 224.0.0.0/24 from ourselves a bit
differently now.
Ticket: CM-11751
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This reverts commit 5bbcd1f0fd.
This commit badly breaks local 'ip igmp join XXX YYY' commands.
Revert this and fix the issue a slightly different way
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Modify the 'show ip pim upstream' command to
show the expected incoming interface for
the source.
Ticket: CM-11220
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive an igmpv3 group report that has
an implied *,g make sure that we look at
the source for the g and handle it appropriately
Ticket: CM-11396
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Several static functions were passing a list around
when the reality is we are going to need to
look at the group information in order to make an
informated decision.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a multicast packet from a source
that is not connected to us, silently ignore it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pim is joining the 224.0.0.13 and 224.0.0.22 groups
This is causing the creation of (*, 224.0.0.13) and
(*, 224.0.0.22) multicast routes which are immediately
sent to the pim network.
If we are the originator of the igmp report than
there is no need to accept the packet for
processing.
Ticket: CM-11397
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When receiving packets and the parse fails
a zlog_err is generated. This should be
protected by a debug.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When pim is receiving packets, each interface's fd is receiving
packets for all interfaces. Modify the code to bind the
pim interface sockets to the interface they were created for.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When a RP receives the register packet, move the (*,G) to a
(S,G) route and send the pim message upstream to the source.
With this change the multicast packets are sent from the
source to the interested parties.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When the kernel looks up a *,G route it
expects the incoming interface to be part
of the outgoing interface ttl list.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When receiving the register packet from another pim
neighbor at the RP, we were adding an incorrect
amount of bytes to find the start of the ip_hdr
of the encapsulated data. This commit fixes
this issue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
in the igmp_group_free path, the normal deletion path
was causing asserts to happen. There is no need
to have asserts here for this reason.
Further testing done w/ valgrind.
Ticket: CM-11401
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Turn some PIM_TRACE to PIM_TRACE_DETAIL. Log file
was getting spammed with unneeded information.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
With the change to moving the pimreg to vifindex 0,
when a packet is kicked up from the kernel to us
we need to install the route into the system.
This change allows us to do this now.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we receive a encapsulated packet from another
pim neighbor, the code needs to grab the group
from the ip_hdr->src.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we create the pim_ifp we need to see if this
interface allows us to elect our selves the RP.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The log line was causing confusion when we
were rotating quagga. None of the other
protocols were logging lines on rotate
so just remove it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This code prevents pim from forming a neighbor relationship
with itself by preventing pim from sending a hello
out the loopback interface if we have pim configured
on an interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Allow pim to separate out the pim vif index from the ifindex.
This change will allow pim to work with up to 255(MAXVIFS)
interfaces, while also allowing the interface ifindex to
be whatever number it needs to be.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When the kernel sends a NOCACHE message to
pim we were looking up the interface to
use for the incoming multicast packet
based upon the source. No need to do
that trust that the kernel has properly
identified it and use that.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
It is possible to create multiple interfaces
with the same ip address. Looking up the
dev to use based upon the ip address will
eventually fail when you keep getting
the same dev device.
Future-Work: I'll need to add a translation
to vif index to actual device to use because
ifindex's are not guaranteed to be under 256.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Valgrind is reporting that pimd is using uninitialized
memory for comparisons. This commit addresses
the issues found there.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra.h pulls in config.h, which results in fiddling with things like
__FILE_OFFSET_BITS. It must always be included first, in order to set
flags that influence the compiler via <features.h>.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 821df2cf18e5978cc7ab532a8695444380d08270)
All functions that call zclient_read_header immediately turn around
and check to ensure that the version and marker fields are correct
Move this code into zclient_read_header
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit a9d4cb33faa6af622240190a80f41c4672374925)
The register message checksum was being calculated over
the first 4 bytes of the packet, instead of the first
8 bytes. From the RFC:
PIM Version, Type, Reserved, Checksum
Described in Section 4.9. Note that in order to reduce
encapsulation overhead, the checksum for Registers is done only
on the first 8 bytes of the packet, including the PIM header and
the next 4 bytes, excluding the data packet portion. For
interoperability reasons, a message carrying a checksum
calculated over the entire PIM Register message should also be
accepted. When calculating the checksum, the IPv6 pseudoheader
"Upper-Layer Packet Length" is set to 8.
Ticket: CM-11265
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Due to rewrite of the redistribution mechanism in ZEBRA,
rehookup the redist statements to pimd from zebra.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pim_pkt_dump was creating a custom function to dump
detailed packet data. Switch it over to use
zlog_hexdump.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We were passing in the interface name when we were also
passing in the igmp pointer which has this information.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
INCLUDES in configure.ac was not used at all, and INCLUDES in
Makefile.am is supposed to be AM_CPPFLAGS these days.
Reduces warnings spewed during bootstrap/autoreconf.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit 237aac56960575f6ad2451ba2796d94bd5ae4b33)
When you enter a static mroute under an interface
the 'show run' is not displaying this information.
Add code to allow this.
Ticket: CM-11257
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
pim has two zclient sockets to zebra. One
is used exclusively to do mrib lookups. The
other is to do the normal day to day communication
between pim and zebra. With the change
to the zebra api to send up all data to all
sockets this caused the mrib lookup socket
to accumulate data in between mrib lookups.
So if at some point in time we get upcoming
data but no mrib lookups modify the code
to find the mrib lookup it is looking for.
Long term we need to figure something else out
but this change will get us moving forward again.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
We were reading a u_int16_t for vrf_id_t. While technically
the same thing, I'd like to make sure we think about vrf_id_t's
as vrf_id_t's.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pim was not parsing route-map code and causing issues
using vtysh because of this. Add code to safely
ignore the route-map code and set us up for future
expansion into route-maps if neeeded.
Ticket: CM-11219
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The addition of the zclient_read_header call
reads the entirety of the stream for you and
makes sure it's consistent with the header.
When the function call was added it read the
stream data in zclient_read_header and then
reread the data after that.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Forward port of vrf code didn't have the pimd
code. So when it was forward ported we lost
the vrf_init. Now that we have pimd let's
add it back in.
Additionally forward port lost the
additional zclient->zebra_connect call.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit fixes these warnings:
1) bgpd/bgp_nexthop.c - dereferencing pointer 'X' does break strict-aliasing rules
2) pimd/pim_igmp_join.c - dereferencing pointer 'X' does break strict-aliasing rules
3) ripd/ripd.c - 'ifaddr.prefixlen' may be used uninitialized in this function
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 26a18eb223d26011ac4f1d608f6775ed7ebf8efb)
* Remove the old change from '08 to add in PIE arguments at automake level.
Versions of libtool since then know how to deal with -fpie and do the right
thing according to whether its building shared or executable objects.
So just pass '-fpie' as CFLAG and let libtool do its thing.
Turns out we were missing $(WERROR) for compiling pimd
so we were not catching compile warning issues.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Modify the code to send a register packet upstream to the RP.
Packet is currently being received but not properly decoded
currently.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The code was hard-coding the (S,G) route to get the
multicast packet up into pimd. This code fixes
this issue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The linux kernel wants a pimreg vif device. The pimd
code wants a 'struct interface *' for anything it works
with. Since the pimreg vif device is not a real linux
device that zebra knows about. Cheat by creating
a pimreg interface pointer and setup the code to
properly be able to handle the registration of the vif
device.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit does two things:
(A) Sets up #defines for the pimreg to be used in pim_mroute.c
(B) Moves add_oif into pim_oil.c where it belongs
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add Source type for (S,G) mroute. This will allow us to know that
a (S,G) route came from an actual Source( ie the kernel called us
back with information about a multicast packet it received with
no mroute for it ).
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we get a NOCACHE call from the kernel, there is
no point generating a mcast route for the packet if
there is no RP configured, or if PIM-SSM is configured
on the interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When receiving data from the kernel from the kernel socket,
some calls that are received are not known what they are.
Provide some more debug code to handle appropriately
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Starting the transition of PIM-SSM to PIM-SM means
that we have to cleanup some internal code comments
so that the code will match the comments.
Signed-off-by: Donald Sharp<sharpd@cumulusnetworks.com
This code starts the handling of the pim register type. No guarantees that
it works correctly, just that it compiles and the start of the code is in there.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd needs the ability to send the multicast packet to the RP.
This code causes the incoming unknown multicast packet to
be send to pimd so it can be sent as a REGISTER packet towards
the RP.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This patch sets up the handling of the 3 basic kernel callbacks:
IGMPMSG_WRONGVIF - When a multicast message comes in the wrong vif
IGMPMSG_NOCACHE - There is no multicast route associated with a received(S,G)
IGMPMSG_WHOLEPKT - There is no outgoing interface for a packet.
The code's debugs are cleaned up to be covered by debug statements
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Start the process of creating the pimreg vif device so that
we can get the callbacks from the kernel with the multicast packets
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The KAT(S,G) timer can now be started and on
expiry the timer clears the PMBR(S,G).
More work needs to be done for when this timer pops, but
good enough of a start now.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
These two timers have some default values. Create the
default defines to be used and start setting up the data
structures for them.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add code to allow on interface up/down events the check of whether
or not this process is the RP.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add the ability for the node to determine if it is the RP or not.
Currently this only allows static RP's.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Receive a (*,G) route and send it upstream to the RP.
The RP at this time does not properly handle the route.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Allow the user to specify the static Rendevous point
as well as specifying that an interface is Sparse Mode.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd was outputting allot of data surrounding pim hello packets.
In addition the debugging was inconsistent and not all turned
on via 'debug pim packet hello'.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This patch cleans up some interface startup, removes duplicate
debug messages and protects against some always being displayed.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
There are PIM packet types that have not been implemented yet.
Notice when we get one of those and safely do nothing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
There are several additional packet types that pimd is unaware of
Add code to allow pim to understand them in the future.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd is very chatty without any pim debugs turned on.
This commit fixes a bunch of the debugs to be protected
by appropriate pim debug statement.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
There is no need to display igmp default values for the query-interval
and the query-max-response-time-dsec
Before change:
!
interface swp4
description swp4 -> host-212's swp1
ip igmp
ip igmp query-interval 125
ip igmp query-max-response-time-dsec 100
ip pim ssm
link-detect
!
After change:
!
interface br1
ip igmp
ip pim ssm
link-detect
!
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Solaris uses the same socket API for IP_PKTINFO as Linux, but doesn't
have a SOL_IP define.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Quagga start has unnecessary pim messages to stdout. Causing some confusion.
Logging is already saving this information in pimd.log
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When caling pim_sock_open if the failure cause happens, however
unlikely, don't leak the fd on failure.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Commit c99f3481a598 has changed the API. Now, the vrfid has been added in
the header, thus we must read it before parsing the rest of the message.
To ease code maintenance, let's add a new function to read a zAPI header.
Fixes: c99f3481a598 ("*: add VRF ID in the API message header")
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Tested-by: Martin Winter <mwinter@opensourcerouting.org>
Create new per interface command:
'ip pim hello <1-180> {<1-180>}'
The first number is the Hello Timer for this interface
The second number is the Hold Timer to pass to neighbors on this interface.
The second number is optional.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The RFC states that an interfaces generation_id must be changed
if it experiences an if down. From 4.3.1:
The GenID option contains a randomly generated
32-bit value that is regenerated each time PIM forwarding is started
or restarted on the interface, including when the router itself
restarts.
Since we are only grabbing a new generation_id without comparing
it to the previous generation_id, it is possible that random
can generate the exact same number.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The DR election is occurring on every hello received.
This is because the hello receive packet returns a 0
for any successfully received packet. PIMD then looked
at the 0 returned and did a DR election.
Code was inspected for the cases where DR should happen:
(A) Interface ip address change
(B) DR priority in hello packet changes
(C) Received a new neighbor on an interface
(D) Neighbor timer pops.
Each of these initiate a DR election in the code currently.
Testing was initiated on a pim network:
tor-11# show ip pim designated-router
NonPri: Number of neighbors missing DR Priority hello option
Interface Address DR Uptime Elections Changes NonPri
br1 20.0.15.1 20.0.15.1 00:08:16 1 1 0
swp1 169.254.0.10 169.254.0.10 00:08:16 2 1 0
swp2 169.254.0.26 169.254.0.26 00:08:16 2 1 0
tor-11#
As you can see Elections == 2. This is because pimd performs
an election on (A) and (C) above. I see no need to modify
(A) to check if we have any knowledge of the interface before
this call.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The function pim_neighbor_new caused the dr election before
the addition of the neighbor to the pim_ifp->pim_neighbor_list,
in pim_neighbor_add, which is needed to properly elect the
correct DR.
Move the dr_election and hello trigger till after the addition
to the list.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
From RFC 4601, Section 4.3.1:
The DR_Priority Option allows a network administrator to give
preference to a particular router in the DR election process by
giving it a numerically larger DR Priority. The DR_Priority Option
SHOULD be included in every Hello message, even if no DR Priority is
explicitly configured on that interface. This is necessary because
priority-based DR election is only enabled when all neighbors on an
interface advertise that they are capable of using the DR_Priority
Option. The default priority is 1.
This modification allows the setting of the DR Priority on a per
interface basis.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Hi,
This patch adds the ability to configure multicast static routes
directly into pimd. Two source files are introduced to implement the new
feature in addition to changes to existing files.
Here is how it can be used the CLI:
interface <incoming interface>
ip mroute <outgoing interface> <group addr> #
for asm
or ip mroute <outgoing interface> <group addr> <source> # for ssm
Please let me know if you have any questions or concerns,
Regards,
Jafar
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
The 'show debugging' cli as setup by pim collided with 'show debugging isis'.
Fix that and clean up cli help commands to actually display correctly.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When pim_upstream_new is called the code looks up the nexthop.
If there is no route to the source, the code silently ignored
the error returned. When the nexthop lookup fails don't create
the 'struct pim_stream *' to return.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
linux/mroutes.h and pim_mroute.h both have copies of the same structures.
This is causing failures in setsockopt(..., MRT_ADD_MFC,...) because
of data structure incompatibilities between the kernel and what
pim_mroute.h was providing. Modify the code to check for mroute.h
and include it if necessary. I did not modify the non linux/mroute.h
path because I do not have other systems to test on easily.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd rolled it's own solution to random #'s, that was not
terribly random. Rely on the underlying system to generate
random #'s for us
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/Makefile.am was missing srcdir/lib from its include paths, breaking
out-of-tree build regarding route_types.h
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ioctl values might be int or long, cast them to unsigned long for
consistent printing. (They're long on FreeBSD, but were printed with
%d.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
While glibc seems to have something in the system headers that prevents
this from triggering a warning, FreeBSD doesn't. Fix the warning.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
The code in pimd needs to be updated to handle the changes
we've made to api's that it depends on.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
this function is used by the currently not present zclient reconnect
code. It'll be unmasked again when that code hits master.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Welcome pimd to the Quagga daemon zoo!
This is a merge of commit 77ae369 ("pimd: Log ifindex found for an
interface when zebra lib reports a new connected address."), with
the intermediate "reconnect" changes removed (c9adf00...d274381).
d274381 is replaced with b162ab7, which includes some changes. In
addition, 4 reconnect-related changes and 1 cosmetic one have been
bumped out.
The rebase command used to produce the branch that is merged here is:
git rebase --onto b162ab7 c9adf00 77ae369
Note that 3 patches had their author rewritten from
"Anonymous SR#108542 <>" (which is not a valid git author ID)
to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address
listed in the associated Savannah ticket)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>