summaryrefslogtreecommitdiff
path: root/pimd
AgeCommit message (Collapse)Author
2020-02-20Merge pull request #5847 from mjstapp/fix_pim_sasQuentin Young
pimd: fix SA reports
2020-02-20pimd: fix SA reportsMark Stapp
Fix a couple of SA warnings introduced recently; replace some 'strcpy' calls. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-20pimd: Make frr able to be built by gcc 10Tomas Korbar
- Add extern modifier to some declarations in header file and move qpim_all_pim_routers_addr definition to pimd/pimd.c `GCC now defaults to -fno-common. As a result, global variable accesses are more efficient on various targets. In C, global variables with multiple tentative definitions now result in linker errors.` Taken from https://gcc.gnu.org/gcc-10/changes.html Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2020-02-14pimd: pim mlag show commandsAnuradha Karuppiah
1. show ip pim mlag summary provides MLAG session information and stats 2. show ip pim mlag upstream displays the upstream entries synced across the MLAG switches Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: handle ipmr-lo operational state changesAnuradha Karuppiah
ipmr-lo is an internally added device used for multicast vxlan tunnel termination. This device is not expected to be managed by the admin however in the case it is accidentally shut we need to be able handle it by recovering when it is "no shut" again. Ticket: CM-24985 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: handle nht metric change correctlyAnuradha Karuppiah
PIM MLAG DF election API was not being triggered on cost change if the upstream neighbor remained the same. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: remove peerlink_rif from the orig-mroute OIL when it is oper downAnuradha Karuppiah
In an anycast VTEP setup the peerlink_rif is added as a static OIF to the originating mroute (bypassing the pim state machine). This is needed to ensure both MLAG switches rx a copy of encapsulated BUM flow. We were not handling link state changes on this static OIF resulting in the wrong vifi being used in the OIL (because of vifi re-allocation). This commit re-acts to oper state changes by deleting the OIF on link down and re-adding it on link up. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: stop overloading SRC_IGMP upstream for vxlan local membershipAnuradha Karuppiah
A local membership is created on the vxlan termination device ipmr-lo. This is done to - 1. Pull multicast vxlan tunnel traffic to the VTEP for termination by triggering JoinDesired on the BUM multicast group. 2. Include the OIF in the mroute to signal to the dataplane component that flow needs to be vxlan terminated. Earlier we were overloading the PIM_UPSTREAM_FLAG_MASK_SRC_IGMP for this local membership creation but that is creating confusion both in the state machine and in the show outputs. To avoid that we use the more apparent PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM. With this change - 1. We get LHR functionality for VXLAN_TERM mroutes 2. OIF is populated with PIM_OIF_FLAG_PROTO_PIM only Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: force update inherited OIL when vxlan local membership is createdAnuradha Karuppiah
When local member is added the (*, G) entry may already be in a JOINED state. In that case the OIL is not updated i.e. pim_channel_add_oif is not happening for ipmr-lo. Because of this the traffic associated with the multicast vxlan tunnel is pulled down to the VTEP but not terminated by the kernel. This change force updates the OIL anytime ipmr-lo is added or removed as a local member. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: skip syncing and running DF election on orig mroutesAnuradha Karuppiah
This is not causing functional problems but has become a source of confusion. DF status is only relevant to multicast tunnel decaps. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: increase RPF metric via the peerlink_rif by plus-10Anuradha Karuppiah
The RPF cost is incremented by 10 if the RPF interface is the peerlink-rif. This is used to force the MLAG switch with the lowest cost to the RPF to become the MLAG DF. If a switch has to go via the peerlink-rif to get to the RP or source it simplly cannot be the designated forwarder. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: inherit MLAG DF role from the parent (*, G) entryAnuradha Karuppiah
DF election is only run for (*,G) entries i.e. election is skipped for (S,G) entries that are setup as a result of SPT switchover. (S,G) entries inherit the DF role from the parent (*,G) entry. So the DF is responsible for terminating all sources associated with a group. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pim: DF election for tunnel termination mroutes in an anycast-VTEP setupAnuradha Karuppiah
1. Upstream entries associated with tunnel termination mroutes are synced to the MLAG peer via the local MLAG daemon. 2. These entries are installed in the peer switch (via an upstream ref flag). 3. DF (Designated Forwarder) election is run per-upstream entry by both the MLAG switches - a. The switch with the lowest RPF cost is the DF winner b. If both switches have the same RPF cost the MLAG role is used as a tie breaker with the MLAG primary becoming the DF winner. 4. The DF winner terminates the multicast traffic by adding the tunnel termination device to the OIL. The non-DF suppresses the termination device from the OIL. Note: Before the PIM-MLAG interface was available hidden config was used to test the EVPN-PIM functionality with MLAG. I have removed the code to persist that config to avoid confusion. The hidden commands are still available. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: register with MLAG on the first VxLAN SGAnuradha Karuppiah
Channel with the MLAG daemon is setup on the first VxLAN BUM MDT or pim-mlag AA SVI. This channel is used for - 1. rxing MLAG status status updates (peer state, role etc.) 2. for syncing active-active upstream entries with the peer MLAG switch. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pimd: Add missing yang callbacks for route-mapsDonald Sharp
Pim was missing the yang callbacks for route-maps, causing it to crash. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-13*: Remove break after returnDonatas Abraitis
Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06*: Replace s_addr 0 => INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-04*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-15doc: rename man pages to frr-*David Lamparter
The vrrpd one conflicts with the standalone vrrpd package; also we're installing daemons to /usr/lib/frr on some systems so they're not on PATH. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-08pimd: lookup nh using vrf_id we checked beforeStephen Worley
Update zclient_lookup_nexthop_once() to create the zapi header using the vrf_id on the pim->vrf struct. This is the one we do a check on a couple lines before, so we should be using it when we actually create the header as well. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-08pimd: allow pimd to handle nexthop_lookup zapi errorStephen Worley
Allow pimd to stop the lookup if zebra tells pimd that the lookup failed due to a zapi error. Otherwise, it will keep waiting for a nexthop message that will never come. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-03pimd: Do not warn for common occurrence in igmp codeDonald Sharp
Do not warn when we receive a multicast address that matches 224.0.0.0/24. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-03pimd: Convert the upstream_list and hash to a rb treeDonald Sharp
Convert the upstream_list and hash to a rb tree, Significant time was being spent in the listnode_add_sort. This reduces this time greatly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-03pimd: Convert the channel_oil_list|hash to a rb_treeDonald Sharp
The channel_oil_list and hash are taking significant cpu at scale when adding to the sorted list. Replace with a RB_TREE. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-22Merge pull request #5584 from qlyoung/pim-fix-iph-trustJafar Al-Gharaibeh
pimd: readd iph length checks
2019-12-22Merge pull request #5581 from Jafaral/pimroute-rfQuentin Young
pimd: refactor ip mroute cmd
2019-12-22pimd: readd iph length checksQuentin Young
Kernel might not hand us a bad packet, but better safe than sorry here. Validate the IP header length field. Also adds an additional check that the packet length is sufficient for an IGMP packet, and a check that we actually have enough for an ip header at all. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-21pimd: fix missing igmp mtrace length checkQuentin Young
We check that the IGMP message is sufficently sized for an mtrace query, but not a response, leading to uninitialized stack read. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-20pimd: refactor ip mroute cmdJafar Al-Gharaibeh
combine: ip mroute INTERFACE A.B.C.D ip mroute INTERFACE A.B.C.D A.B.C.D into: ip mroute INTERFACE A.B.C.D [A.B.C.D] Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2019-12-16Merge pull request #5427 from liam-mcb/igmp-join-anyDonald Sharp
pimd: Add command to join any-source multicast.
2019-12-12pimd: Add command to join any-source multicast.Liam McBirnie
Allow 'ip igmp join' to join group for any source if no source is specified. Disallow joining source "0.0.0.0" as it is used to define an any-source multicast group. Signed-off-by: Liam McBirnie <liam.mcbirnie@boeing.com>
2019-12-10pimd: clear SA warning in pimdMark Stapp
Remove a dead store in pim_upstream.c to clear up an SA warning. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06Merge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixesJafar Al-Gharaibeh
PIM state machine fixes
2019-12-06Merge pull request #4765 from opensourcerouting/defaults-v2Donald Sharp
lib/*: new config defaults system, v2
2019-12-06lib: rename memory_vty.c to lib_vty.cDavid Lamparter
And memory_init() to lib_cmd_init(). Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-04eigrpd, ospfd, pimd: Fix assumption that interface may not be upDonald Sharp
Commit: ddbf3e60604019d4b38d51226700e2244cc531b6 This commit modified the interface up handling code in ZAPI such that the zclient handled the decoding for you. Prior to this commit ospf assumed that it could use the old ifp pointer to know state before reading the stream. This lead to a situation where ospf would `smartly` track and do the right thing in this situation. This commit changed this assumption and in certain scenarios, say a interface was changed after it was already up would lead to situations where ospf would not properly handle the new interface up. Modify ospf to track data that is important to it in it's interface->info pointer. This code pattern was followed in both eigrp and pim. In eigrp's case it was just behaving weirdly in any event so fixing this pattern is not a big deal. In pim's case it was not properly using this so it's a no-op to fix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30*: make frr_yang_module_info constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-22pimd: eval use_rpt on new upstream post IIF setup but before MFC programmingAnuradha Karuppiah
use_rpt macro depends on JoinDesired macro and is mostly independent of the actual RPF interface i.e. doesn't change when the RPF interface changes. There is however one exception to this handling and that is on the first hop router (DR or non-DR). On the DR the FHR flag is set so the RPF interface stays irrelevant to use_rpt eval. But on the non-DR the IIF is the only way to know we are directly connected to the SG i.e. to know that we must NOT switch the source to RPT. This commit fixes up the order of use_rpt eval - 1. it is done before mroute programming 2. but after IIF setup, for SRC_NOCACHE and STATIC_IIF upstream entries Note: drop an unnecessary check to verify that the RPF interface is pim enabled. This is just to make the code consistent. Ticket: CM-27446 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-22Merge pull request #5328 from satheeshkarra/pim_mlagMark Stapp
pimd, lib, zebra : PIM MLAG Support
2019-11-20pimd: fixup whitespace errors reported by CIAnuradha Karuppiah
No functional changes. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-20pimd: drop redundant checks for RPF interfaceAnuradha Karuppiah
pim_upstream_kat_start_ok was checking if RPF interface was present, twice! Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-19pimd: fix bsm buflen check to include pim hdrQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-11-19pimd: Various buffer overflow reads and crashesDonald Sharp
A variety of buffer overflow reads and crashes that could occur if you fed bad info into pim. 1) When type is setup incorrectly we were printing the first 8 bytes of the pim_parse_addr_source, but the min encoding length is 4 bytes. As such we will read beyond end of buffer. 2) The RP(pim, grp) macro can return a NULL value Do not automatically assume that we can deref the data. 3) BSM parsing was not properly sanitizing data input from wire and we could enter into situations where we would read beyond the end of the buffer. Prevent this from happening, we are probably left in a bad way. 4) The received bit length cannot be greater than 32 bits, refuse to allow it to happen. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19pimd: exclude pimreg from the inherited OILAnuradha Karuppiah
Inherited OIL is used as a part of the JoinDesired macro. And in FRR we use the channel OIL as the inherited OIL (to reduce processing overhead everytime JD needs to be re-evaluated). On a FHR pimreg is a part of the channel-OIL but must not be used for JD computation. This commit blacklists pimreg from the inherited_oil i.e. present but ignored. Note: This fixup is being done to address topotest failures. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-19zebra,pim : Fixing Review comments in PIM_MLAGSatheesh Kumar K
Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-19pimd: Fix possible read beyond end of data receivedDonald Sharp
If a register packet is received that is less than the PIM_MSG_REGISTER_LEN in size we can have a possible situation where the data being checksummed is just random data from the buffer we read into. 2019/11/18 21:45:46 warnings: PIM: int pim_if_add_vif(struct interface *, _Bool, _Bool): could not get address for interface fuzziface ifindex=0 ==27636== Invalid read of size 4 ==27636== at 0x4E6EB0D: in_cksum (checksum.c:28) ==27636== by 0x4463CC: pim_pim_packet (pim_pim.c:194) ==27636== by 0x40E2B4: main (pim_main.c:117) ==27636== Address 0x771f818 is 0 bytes after a block of size 24 alloc'd ==27636== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==27636== by 0x40E261: main (pim_main.c:112) ==27636== Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-18Merge pull request #5360 from donaldsharp/pim_crash_rpJafar Al-Gharaibeh
Pim crash rp
2019-11-18pimd: Create pimreg interface when we start any interface configDonald Sharp
When you configure interface configuration without explicitly configuring pim on that interface, we were not creating the pimreg interface and as such we would crash in an attempted register since the pimreg device is non-existent. The crash is this: ==8823== Invalid read of size 8 ==8823== at 0x468614: pim_channel_add_oif (pim_oil.c:392) ==8823== by 0x46D0F1: pim_register_join (pim_register.c:61) ==8823== by 0x449AB3: pim_mroute_msg_nocache (pim_mroute.c:242) ==8823== by 0x449AB3: pim_mroute_msg (pim_mroute.c:661) ==8823== by 0x449AB3: mroute_read (pim_mroute.c:707) ==8823== by 0x4FC0676: thread_call (thread.c:1549) ==8823== by 0x4EF3A2F: frr_run (libfrr.c:1064) ==8823== by 0x40DCB5: main (pim_main.c:162) ==8823== Address 0xc8 is not stack'd, malloc'd or (recently) free'd pim_register_join calls pim_channel_add_oif with: pim_channel_add_oif(up->channel_oil, pim->regiface, PIM_OIF_FLAG_PROTO_PIM); We just need to make srue pim->regiface exists once we start configuring pim. Fixes: #5358 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-18pimd: Dissallow obvious addresses from being the RPDonald Sharp
When configuring a RP, dissallow the choice of 0.0.0.0 or 255.255.255.255 as the address as that they make no sense what so ever. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>