Commit graph

752 commits

Author SHA1 Message Date
Donald Sharp 35e5ef55f1 pimd: Modify show ip pim assert to only show interesting bits
`show ip pim assert` shows S,G ifchannel information even when
there is no information available about the assert process.

Fix the code to not dump non-interesting cases.

Fixes: 10462
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-07 19:55:00 -05:00
Donatas Abraitis 77a2f8e592 *: Add camelCase JSON keys in addition to PascalCase
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-03 10:48:06 +02:00
Donatas Abraitis 3757f96485 bgpd,pimd,isisd,nhrpd: Convert to vty_json()
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-31 21:20:41 +02:00
David Lamparter 414db8e341
Merge pull request #10395 from qlyoung/fix-pim-xpath-buffer-sizes 2022-01-25 17:22:39 +01:00
Sai Gomathi 4527b70aed pimd: json support added for command "show ip igmp sources"
Add JSON support in the show command
“show ip igmp sources” with proper formatting.

Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2022-01-25 06:29:37 -08:00
Quentin Young d7073b211a pimd: fix misuse of xpath buf size constants
XPATH_MAXLEN denotes the maximum length of an XPATH. It does not make
sense to allocate a buffer intended to contain an XPATH with a size
larger than the maximum allowable size of an XPATH. Consequently this PR
removes buffers that do this. Prints into these buffers are now checked
for overflow.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-01-24 11:13:28 -05:00
Quentin Young 9e84443aca
Merge pull request #10398 from patrasar/pim_debug_fix 2022-01-21 14:08:48 -05:00
sarita patra 5c4508cb32 pimd: debug pim fixes
Enable debug commands "debug pim packetdump send" and
"debug pim packetdump receive" in config mode.

Display "debug pim nht rp" in show running config.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-01-21 03:05:18 -08:00
David Lamparter 8e8be741b5 pimd: replace pim_inet4_dump with %pPAs
Only pim_sgaddr uses are covered by this since regular in_addr is still
used for singular addresses, so only a part of pim_inet4_dump calls are
gone with this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:10:57 +01:00
sarita patra 3051f4438d pim: Keeping list of address-family under gmp container
Renamed frr-igmp.yang to frr-gmp.yang, igmp to gmp container.
to support IGMP and MLD protocol.

frr-gmp.yang, created a list of address family under mgmd
container. For PIMV4 the key is IPV4, where as for PIMV6
the key is IPV6. This is done for PIMV6 development.

This commit will have all the northbound changes to support
IPV4 address family.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-01-17 05:10:20 -08:00
David Lamparter 62f59b58ba pimd: deploy pim_sgaddr_* helpers
Use _cmp/_hash/_match helpers for operations on pim_sgaddr to prepare
IPv6 support.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:08:58 +01:00
David Lamparter 032a741219 pimd: move & deploy pim_addr_cmp() helper
Comparing `s_addr` isn't cutting it for IPv6 support.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:08:29 +01:00
David Lamparter 2a27f13b21 pimd: move, rename and deploy pim_addr_is_any()
Replaces comparison against INADDR_ANY, so we can do IPv6 too.

(Renamed from "pim_is_addr_any" for "pim_addr_*" naming pattern, and
type fixed to bool.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:03:26 +01:00
David Lamparter 98a81d2bff pimd: remove pim_str_sg_dump()
... and replace with `%pSG` printfrr specifier.  This actually used a
static buffer in the formatting function, so subsequent formatting would
overwrite earlier uses.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:02:18 +01:00
David Lamparter 40a19188d5
Merge pull request #10179 from patrasar/pimv6_northbound 2022-01-17 13:23:21 +01:00
David Lamparter cda1f5e098 pim6d: drop off MSDP code
There is no MSDP for IPv6, so drop this code out of pim6d.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 20:32:41 +01:00
David Lamparter 1c4d0ea4b3
Merge pull request #10279 from SaiGomathiN/pim_intf 2022-01-13 16:13:54 +01:00
sarita patra 698f414748 pim: Northbound changes accomodating IPV4 address family
frr-pim.yang, created a list of address family under pim
container. For PIMV4 the key is IPV4, where as for PIMV6
the key is IPV6. This is done for PIMV6 development.

This commit will have all the northbound changes to support
IPV4 address family.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-01-13 02:50:49 -08:00
David Lamparter 6fff2cc620 pimd: prefix_sg => pim_sgaddr
Mostly just 2 sed calls:

- `sed -e 's%struct prefix_sg%pim_sgaddr%g'`
- `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'`

Plus a bunch of fixing whatever that broke.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12 18:24:25 +01:00
Sai Gomathi 18adcff1c0 pimd: Modifying members of pim_interface to accommodate IPv6 changes
Modifying the members of pim_interface which are to be used
for both IPv4 and IPv6 to common names(for both MLD and IGMP).

Issues: #10023

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2022-01-11 03:18:06 -08:00
Stephen Worley ad1229a077
Merge pull request #10215 from FRRouting/revert-10164-name_change
Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"
2021-12-15 17:40:53 -05:00
David Lamparter 62646e1350
Merge pull request #10167 from mobash-rasool/pim-upst-1 2021-12-14 17:54:22 +01:00
David Lamparter 29e5822590
Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes" 2021-12-14 17:33:24 +01:00
nsaigomathi 761e4fbad8 pimd: IGMP Query Generation
Problem:
=======
Generate query once cli is generating IGMPv2 report for IGMPv3 enabled interface

Description:
===========
If the version is not specified in the cli, it was taking version 2 as default

Fix:
===
If the version is not specified in the cli along with ip igmp generate-query-once,
the default will be the version enabled on that interface.

Signed-off-by: nsaigomathi <nsaigomathi@vmware.com>
2021-12-13 23:35:01 -08:00
Sai Gomathi c5f76fad1a pimd: Modifying struct igmp_sock to gm_sock for IPv6
Modifying name of struct igmp_sock to struct gm_sock, which is to be used
by both IPv4 and IPv6(for both MLD and IGMP).

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-03 10:27:12 -08:00
Sai Gomathi a16db099e4 pimd: Modifying name of struct igmp_group to struct gm_group for IPv6.
Modifying name of struct igmp_group to struct gm_group, which is to be used
by both IPv4 and IPv6(for both MLD and IGMP).

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-03 10:11:13 -08:00
Sai Gomathi 517001077f pimd: Modifying name of struct igmp_source to struct gm_source for IPv6.
Modifying name of struct igmp_source to struct gm_source, which is to be used
by both IPv4 and IPv6(for both MLD and IGMP).

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-03 10:10:40 -08:00
Mobashshera Rasool 7caa9451af pimd: Modifying name of struct igmp_join to struct gm_join to accomodate IPv6 changes.
Fix:
====
Modifying name of struct igmp_join to struct gm_join, which is to be used
by both IPv4 and IPv6(for both MLD and IGMP).

Co-authored-by: Abhishek N R abnr@vmware.com
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-12-03 09:35:27 -08:00
Sai Gomathi ea7d74d702 pimd: Modifying members of pim_interface to accommodate IPv6 changes
Modifying the members of pim_interface which are to be used
for both IPv4 and IPv6 to common names(for both MLD and IGMP).

Issue: #10023

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-02 23:12:58 -08:00
Donatas Abraitis 4e9a98636f *: Remove unused variables
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18 18:45:41 +02:00
Donatas Abraitis b0d5264e3f pimd: Replace inet_ntop to %pI4/6 for JSON outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18 18:45:41 +02:00
David Lamparter b09bd804ac pimd: move BSM clear into BSM code
... where it actually belongs.  And make a bunch of stuff static, since
it's no longer used across files now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17 11:17:44 +01:00
David Lamparter 4efdb9c628 pimd: clean up BSR NHT & fix parallel links
The Bootstrap message RX path needs a RPF check for the BSR address,
and this is implemented both incorrectly as well as quite ugly.

Clean up and fix case when we have multiple interfaces to the same LAN
and/or ECMP nexthops (both would cause message duplication, the former
can even cause BSM forwarding loops.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17 11:17:44 +01:00
Donald Sharp e1d1b1dec7 pimd: Remove default from enum based switch
enum based switches should never use default.  It makes
it very hard to fix and find issues when the enum is
changed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-10 17:35:22 -05:00
Russ White 5393318d81
Merge pull request #9682 from adrianomarto/mesh-group-fix
pimd: fixing command "no ip msdp mesh-group member"
2021-09-28 10:21:17 -04:00
Adriano Marto Reis 4687748973 pimd: fixing command "no ip msdp mesh-group member"
Deleting a mesh-group member no longer deletes the mesh-group.

Complete bug description at:
https://github.com/FRRouting/frr/issues/9664

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2021-09-28 12:43:52 +10:00
David Lamparter 200f56710a pimd: fix UAF/heap corruption in BSM code
This `XFREE()` call is in plainly in the wrong spot.  `rp_all` (the
224.0.0.0/4 entry) isn't supposed to be free'd ever, and the
conditional above makes quite clear that it remains in use.

It may be possible to exploit this as a heap corruption bug, maybe even
as RCE.  I haven't tried; I randomly noticed this while working on the
BSM code.  Luckily this code is only run by the CLI for the clear
command, so the surface is very small.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-09-27 10:37:23 +02:00
David Lamparter a1a4295ade pimd: reformat after dropping indent levels
Intentionally separate here because the previous patch does a whole
bunch of "move stuff up 1 level of indentation", and reviewing that is
easier when you can use the ignore-whitespace option on diff.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-27 10:46:53 +02:00
David Lamparter dda4d23cca pimd: IGMP memberships are not querier specific
IGMP group/source memberships are a property of the interface;  the
particular IP address that the querier used to collect the data is
irrelevant.

... and IGMP packets get delivered only once to pimd anyway, since we
receive them on the "global" per-VRF IGMP socket.  (The one in igmp_sock
is only used for sending queries.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-27 10:42:53 +02:00
Christian Hopps 11ca35875c pimd: change ranges to 1..max, type align with IETF YANG.
While defaults are good picks for "reasonable" guesses, min and max
range values really aren't. Operators and experimenters often like to
configure "unreasonable" values to stress test, tests boundary
conditions and explore innovations.

With that in mind, change all ranges to 1..max (of type).

While we're here add optional ignored values in the "no" CLI forms.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-18 22:08:33 -04:00
Donatas Abraitis 7e736c7706
Merge pull request #9253 from donaldsharp/igmp_no
pimd: Allow more permisive versions of some no commands
2021-08-07 22:49:25 +03:00
Donald Sharp bb9ff200b3 pimd: Allow more permisive versions of some no commands
Some no commands were not accepting values and left us in
a situation where a cut-n-paste of the non-no line would
not be properly accepted.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-08-01 20:22:36 -04:00
Igor Ryzhov 9da01b0b7b *: cleanup interface node installation
The only difference in daemons' interface node definition is the config
write function. No need to define the node in every daemon, just pass
the callback as an argument to a library function and define the node
there.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-29 21:35:25 +03:00
Donald Sharp 53dc1b16aa pimd: Allow join prune intervals to be as small as 5 seconds
Allow the join-prune interval to be as small as 5 seconds instead
of limiting the value to 60.

This can and will come at a price of being able to converge less
mroutes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-26 10:02:21 -04:00
Donald Sharp 6afa0b137a
Merge pull request #8983 from mobash-rasool/pim-upstreaming-activity
pimd: Minor fixes for BSM Show CLI and Hold Timer CLI
2021-07-22 08:35:06 -04:00
github login name 142774530a pimd: make pim interface hold interval range 1-630
Making the interface holdtime range to 3.5 times the hello-time

As per 7761, Section 4.11:
The Holdtime in a Hello message should be set to
   (3.5 * Hello_Period), giving a default value of 105 seconds.

Therefore providing the user also to configure max upto 3.5 times
the hello timer interval.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-06 22:51:10 -07:00
github login name 9a7cee2673 pimd: To print querierIP address on the querier and nonQuerier IGMP enabled intf
1. Add the querierIP object to igmp_sock datastruct to save the IP address of the querier.
   Management of the querierIP object is added.
2. To show the querier IP address in the CLI "show ip igmp interface".
3. To add the json object querierIP for querier IP address in the json CLI "show ip igmp interface json".

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-06 00:14:28 -07:00
github login name 6eedc1a5b9 pimd: Adding BSM status in the show commands
Adding BSM status in the CLI and json output for
"show ip pim interface"

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-05 04:29:02 -07:00
Rafael Zalamena 622fd3f11e pimd: support MSDP global timers configuration
Users can now configure:

 * Hold time
 * Keep alive
 * Connection retry

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-07-01 09:59:51 -03:00
Donald Sharp 70ec4ea388
Merge pull request #8871 from opensourcerouting/msdp-peer-rework
pimd: rework MSDP peer and add tests
2021-07-01 07:31:21 -04:00
Jafar Al-Gharaibeh 530b12cf6e pimd: make show ip mroute output consistent
We had 3 different string output formats in various places.
Make them all the same.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2021-06-29 14:19:35 -05:00
Rafael Zalamena 0ce04a08a3 pimd: allow MSDP group name 'default'
Don't assign a default group name for non meshed group peers, instead
use a flag.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25 15:06:20 -03:00
Rafael Zalamena 56697b3e0a pimd: rework MSDP northbound integration
Simplify the MSDP handling functions and allow source changes.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25 15:06:20 -03:00
Rafael Zalamena e2809e618b pimd: rework MSDP mesh-group code
Fully utilize the northbound to hold pointers to our private data
instead of searching for data structures every time we need to change a
configuration.

Highlights:

 * Support multiple mesh groups per PIM instance (instead of one)
 * Use DEFPY instead of DEFUN to reduce code complexity
 * Use northbound private pointers to store data structures
 * Reduce callback names size

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-09 12:32:24 -03:00
Martin Winter 202af4abaa
Merge pull request #8616 from donaldsharp/pim_ordering
pimd: There exists a path where on vrf bringup we do not create the p…
2021-05-20 18:49:56 +02:00
Christian Hopps 3bb513c399 lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of:
https://github.com/CESNET/libyang

staticd init load time of 10k routes now 6s vs ly1 time of 150s

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-13 16:24:48 -04:00
Donald Sharp d3cc1e4518 pimd: Remove pim->vrf_id and use pim->vrf->vrf_id
VRF creation can happen from either cli or from
knowledged about the vrf learned from zebra.
In the case where we learn about the vrf from
the cli, the vrf id is UNKNOWN.  Upon actual
creation of the vrf, lib/vrf.c touches up the vrf_id
and calls pim_vrf_enable to turn it on properly.
At this point in time we have a pim->vrf_id of
UNKNOWN and the vrf->vrf_id of the right value.

There is no point in duplicating this data.  So just
remove all pim->vrf_id and use the vrf->vrf_id instead
since we keep a copy of the pim->vrf pointer.

This will remove some crashes where we expect the
pim->vrf_id to be usable and it's not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 14:36:59 -04:00
David Lamparter 4666232247
Merge pull request #8631 from dslicenc/pimd-timer-fix 2021-05-09 19:31:36 +02:00
Don Slice bb4b6eb547 pimd: stop displaying global parameters in each vrf
Problem reported that when certain pim commands were entered, they
showed up duplicated in the configuration both under default instance
and every vrf (whether pim was used there or not.) This was because
these particular parameters are global only and the function doing
the display would repeat for each vrf. This fix only displays those
in the default case (and removes them from the help for entering
under a vrf.)

Signed-off-by: Don Slice <dslice@nvidia.com>
2021-05-05 08:11:27 -04:00
Donald Sharp 2fd97fd87d
Merge pull request #8614 from opensourcerouting/msdp-fixes
pimd: MSDP trivial fixes
2021-05-04 07:21:51 -04:00
David Lamparter fdab294037 pimd: cleanup & convert bsm_rpinfo to TS list
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:56:51 +02:00
David Lamparter d4a4525c12 pimd: cleanup & convert bsm_info to TS list
Just some cleanup before I touch this code;  switching to typesafe list
macros & putting the data directly inline.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:55:59 +02:00
Rafael Zalamena 5a1a392032 pimd: reduce code duplication
Standardize a function to get the current VRF node name.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-05-03 12:30:02 -03:00
Rafael Zalamena 745b8d4a68 pimd: support BFD profiles configuration
Allow users to pre configure BFD sessions with a profile.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-23 09:29:00 -03:00
Rafael Zalamena 1f3e6bf585 pimd: rework BFD integration
Rewrite the BFD integration code to use the new library.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-23 09:28:57 -03:00
Mobashshera Rasool 93839459dc pimd: in 'no ip pim hello' add hold time as optional when hello interval given
Issue:
  User is allowed to configure only hello without hold timer but when undo
  config, the hold timer is mandatory as shown below:
  FRR-4(config-if)# ip pim hello 10
    <cr>
    (1-180)  Time in seconds for Hold Interval
  FRR-4(config-if)# ip pim hello 10
  FRR-4(config-if)# no ip pim hello 10
    (1-180)  Time in seconds for Hold Interval
  FRR-4(config-if)# no ip pim hello 10
  % Command incomplete: no ip pim hello 20

Fix:
  Making the hold timer as optional when undo config.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-03-25 10:27:48 +00:00
Mobashshera Rasool 899dd3392a pimd: Validation that hello should be less than hold time config.
Also included display of hold time in CLI 'show ip pim int <intf>' cmd
and json commands.

Issue:
PIM neighbor not coming up if hold time is less than hello timer
since hello is sent every 4 sec and hold is 1 sec,
because of this nbr is flapping

Fix:
Do not allow configuration of hold timer less than hello timer
Also reset the value of hold timer to 3.5 times to hello whenever
only hello is modified so that the relationship holds good.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-03-25 10:27:40 +00:00
Wesley Coakley cd72ad0133
pimd: show ip mroute column realign
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-03-02 12:19:53 -05:00
Donald Sharp 6599008a0f
Merge pull request #8044 from SaiGomathiN/nsg
pimd: json support added
2021-02-15 18:55:01 -05:00
nsaigomathi 85c8286666 pimd: json support added
Modify code to add JSON format output in show command.
"show ip igmp [vrf NAME] join" and "show ip igmp vrf all join" with proper formatting

Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-02-09 05:33:14 -08:00
Igor Ryzhov 1ac88792c0 *: fix all backets
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-02-02 19:11:25 +03:00
vdhingra e7016ceb4c pimd : Added the command to clear the pim bsr data.
This command has been added in the context of
PIM BSM functionality. This command will clear the
data structs having bsr information.

Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2021-01-08 04:45:49 -08:00
Jafar Al-Gharaibeh d1e82cfd18
Merge pull request #7739 from mobash-rasool/pim-fixes
pimd: correcting the  definition for  Mroute flag "R"
2020-12-15 16:14:32 -06:00
Mobashshera Rasool e9376c880a pimd: correcting the definition for Mroute flag "R"
The flag "R" in below display description denotes the
SGRpt Pruned but the description shows something else
hence correcting the definition.

R2(config)# do show ip mroute
IP Multicast Routing Table
Flags: S- Sparse, C - Connected, P - Pruned
R - RP-bit set, F - Register flag

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-12-15 12:36:34 +00:00
Donatas Abraitis 3a6290bdd1 *: Replace s_addr check agains 0 with INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-14 21:03:38 +02:00
Sarita Patra 851cb2e5de pimd: mesh group not removed when configured for multiple groups
Issue:
Configure msdp mesh mg1 for 2 groups.
ip msdp mesh-group mg1 member 1.1.1.1
ip msdp mesh-group mg1 member 1.1.1.2

Remove mg1 for 1.1.1.1
no ip msdp mesh-group mg1 member 1.1.1.1

mg1 for 1.1.1.1 still present. This is fixed.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-12-01 05:35:57 -08:00
Sarita Patra e224558939 pimd: rp not removed when configured for multiple groups
Issue:
Configure RP.
ip pim rp 20.0.0.1 239.1.1.1/32
ip pim rp 20.0.0.1 239.1.1.2/32

Remove RP.
no ip pim rp 20.0.0.1 239.1.1.1/32
Rp is not removed. This is fixed now.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-12-01 05:34:54 -08:00
Mark Stapp 521c5b9de8 pimd: fix formatting in pim_cmd.c
Fix whitespace/indentation in pim_cmd.c

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-20 16:43:42 -05:00
Mark Stapp 5c90f56906 pimd: fix compilation errors in pim_cmd.c
Fix buffer sizes to eliminate compiliation warnings.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-20 15:45:32 -05:00
Donald Sharp cac886dd53
Merge pull request #6145 from patrasar/pim_nb_code_upstream
pimd: northbound backend code
2020-11-19 11:03:00 -05:00
Sarita Patra 1dac87c88d pimd: fix indentation issues
Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-18 23:20:26 -08:00
Donald Sharp f8ca1bb935 pimd: A buffer may be used uninited
If we screw up and don't have the right flags we'll print
out garbage.  At the very least just print out nothing.

Signed-off-by: Donald Sharp <sharp@nvidia.com>
2020-11-18 11:42:06 -05:00
Sarita Patra 7003f63613 pimd: Northbound implementation for rp commands.
ip_pim_rp
ip_pim_rp_prefix_list
no_ip_pim_rp
no_ip_pim_rp_prefix_list

module: frr-pim-rp

  augment /frr-routing:routing/frr-routing:control-plane-protocols/frr-routing:control-plane-protocol/frr-pim:pim/frr-pim:address-family:
    +--rw rp
       +--rw static-rp
          +--rw rp-list* [rp-address]
             +--rw rp-address                     ietf-inet-types:ip-address
             +--rw (group-list-or-prefix-list)?
                +--:(group-list)
                |  +--rw group-list*   ip-multicast-group-address-prefix
                +--:(prefix-list)
                   +--rw prefix-list?   plist-ref

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:42:00 -08:00
Sarita Patra 0c949724d3 pimd: Northbound implementation for mlag, register-accept-list commands
pim_register_accept_list
ip_pim_mlag
no_ip_pim_mlag

Yang Model:
  augment /frr-routing:routing/frr-routing:control-plane-protocols/frr-routing:control-plane-protocol:
    +--rw pim
       +--rw address-family* [address-family]
          +--rw address-family          identityref
          +--rw mlag!
          |  +--rw peerlink-rif?   frr-interface:interface-ref
          |  +--rw reg-address?    ietf-inet-types:ip-address
          |  +--rw my-role?        enumeration <MLAG_ROLE_NONE>
          |  +--rw peer-state?     boolean <false>
          +--rw register-accept-list?   plist-ref

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:42:00 -08:00
Sarita Patra cf740d2e72 pimd: Northbound implementation for msdp mesh group, msdp peer commands
ip_msdp_peer
no_ip_msdp_peer
ip_msdp_mesh_group_member
no_ip_msdp_mesh_group_member
ip_msdp_mesh_group_source
no_ip_msdp_mesh_group_source
no_ip_msdp_mesh_group

Yang Model:
  augment /frr-routing:routing/frr-routing:control-plane-protocols/frr-routing:control-plane-protocol:
    +--rw pim
       +--rw address-family* [address-family]
          +--rw address-family          identityref
          +--rw msdp-mesh-group!
          |  +--rw mesh-group-name?   string
          |  +--rw member-ip*         ietf-inet-types:ip-address
          |  +--rw source-ip?         ietf-inet-types:ip-address
          +--rw msdp-peer* [peer-ip]
          |  +--rw peer-ip      ietf-inet-types:ip-address
          |  +--rw source-ip?   ietf-inet-types:ip-address

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:42:00 -08:00
Sarita Patra f206085e19 pimd: Northbound implementation for ssm prefix-list, ssmpingd command
ip_pim_ssm_prefix_list
no_ip_pim_ssm_prefix_list
no_ip_pim_ssm_prefix_list_name
no_ip_ssmpingd
ip_ssmpingd

Yang Model:
  augment /frr-routing:routing/frr-routing:control-plane-protocols/frr-routing:control-plane-protocol:
    +--rw pim
       +--rw address-family* [address-family]
          +--rw address-family          identityref
          +--rw ssm-prefix-list?        plist-ref
          +--rw ssm-pingd-source-ip*    ietf-inet-types:ip-address

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:42:00 -08:00
Sarita Patra db9cca95be pimd: Northbound implementation for send-v6-sec and spt switchover cmds
ip_pim_v6_secondary
no_ip_pim_v6_secondary
ip_pim_spt_switchover_infinity
ip_pim_spt_switchover_infinity_plist
no_ip_pim_spt_switchover_infinity
no_ip_pim_spt_switchover_infinity_plist

Yang Model:
  augment /frr-routing:routing/frr-routing:control-plane-protocols/frr-routing:control-plane-protocol:
    +--rw pim
       +--rw address-family* [address-family]
          +--rw address-family          identityref
          +--rw send-v6-secondary?      boolean <true>
          +--rw spt-switchover
          |  +--rw spt-action?                 enumeration <PIM_SPT_IMMEDIATE>
          |  +--rw spt-infinity-prefix-list?   plist-ref

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Sarita Patra 49c6b2aac8 pimd: Northbound implementation for ecmp, rebalance, KA timer.
ip_pim_ecmp
no_ip_pim_ecmp
ip_pim_ecmp_rebalance
no_ip_pim_ecmp_rebalance
ip_pim_rp_keep_alive
no_ip_pim_rp_keep_alive
ip_pim_keep_alive
no_ip_pim_keep_alive

Yang Model:
  augment /frr-routing:routing/frr-routing:control-plane-protocols/frr-routing:control-plane-protocol:
    +--rw pim
       +--rw ecmp?                  boolean <false>
       +--rw ecmp-rebalance?        boolean <false>
       +--rw keep-alive-timer?      uint16 <210>
       +--rw rp-keep-alive-timer?   uint16 <210>

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Sarita Patra d27b7884fb pimd: Northbound implementation for pim router commands.
ip_pim_joinprune_time
no_ip_pim_joinprune_time
ip_pim_register_suppress
no_ip_pim_register_suppress
ip_pim_packets
no_ip_pim_packets

Yang Model:
module: frr-pim
  +--rw pim
     +--rw packets?                  uint8 <3>
     +--rw join-prune-interval?      uint16 <60>
     +--rw register-suppress-time?   uint16 <60>

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Sarita Patra 675c8fdef0 pimd: Northbound implementation for mroute, use-source, boundary_oil cmd
interface_ip_pim_boundary_oil
interface_no_ip_pim_boundary_oil
interface_ip_mroute
interface_no_ip_mroute
interface_pim_use_source
interface_no_pim_use_source

Yang Model:
  augment /frr-interface:lib/frr-interface:interface:
    +--rw pim!
       +--rw address-family* [address-family]
          +--rw address-family            identityref
          +--rw use-source?               ietf-inet-types:ip-address
          +--rw multicast-boundary-oil?   plist-ref
          +--rw mroute* [source-addr group-addr]
             +--rw oif?           frr-interface:interface-ref
             +--rw source-addr    ietf-inet-types:ip-address
             +--rw group-addr     ietf-routing-types:ip-multicast-group-address

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Sarita Patra b73779d3d0 pimd: Northbound implementation for pim bfd commands.
ip_pim_bfd
ip_pim_bfd_param
no_ip_pim_bfd
no_ip_pim_bfd_param

Yang Model:
  augment /frr-interface:lib/frr-interface:interface:
    +--rw pim!
       +--rw bfd!
       |  +--rw min-rx-interval?   uint16 <300>
       |  +--rw min-tx-interval?   uint16 <300>
       |  +--rw detect_mult?       uint8 <3>

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Sarita Patra e3eb2bab27 pimd: Northbound implementation for pim commands.
interface_ip_pim_drprio
interface_no_ip_pim_drprio
interface_ip_pim_activeactive
interface_ip_pim_hello
interface_no_ip_pim_hello
ip_pim_bsm
no_ip_pim_bsm
ip_pim_ucast_bsm
no_ip_pim_ucast_bsm

Yang Model:

 augment /frr-interface:lib/frr-interface:interface:
    +--rw pim!
       +--rw hello-interval?   uint8 <30>
       +--rw hello-holdtime?   uint8
       +--rw bsm?              boolean <false>
       +--rw unicast-bsm?      boolean <false>
       +--rw active-active?    boolean <false>
       +--rw dr-priority?      uint32 <1>

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Sarita Patra 50d194f8c8 pimd: Northbound implementation for pim commands.
interface_ip_pim_ssm
interface_ip_pim_sm
interface_ip_pim
interface_no_ip_pim_ssm
interface_no_ip_pim_sm
interface_no_ip_pim

Yang Model:

augment /frr-interface:lib/frr-interface:interface:
    +--rw pim!
       +--rw pim-enable?       boolean <false>

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Sarita Patra b0475d5a52 pimd: Northbound implementation for igmp commands.
interface_ip_igmp
interface_no_ip_igmp
interface_ip_igmp_join
interface_no_ip_igmp_join
interface_ip_igmp_query_interval
interface_no_ip_igmp_query_interval
interface_ip_igmp_version
interface_no_ip_igmp_version
interface_ip_igmp_query_max_response_time
interface_no_ip_igmp_query_max_response_time
interface_ip_igmp_query_max_response_time_dsec
interface_no_ip_igmp_query_max_response_time_dsec
interface_ip_igmp_last_member_query_count
interface_no_ip_igmp_last_member_query_count
interface_ip_igmp_last_member_query_interval
interface_no_ip_igmp_last_member_query_interval

IGMP yang tree:
module: frr-igmp
  augment /frr-interface:lib/frr-interface:interface:
    +--rw igmp!
       +--rw igmp-enable?                  boolean <false>
       +--rw version?                      uint8
       +--rw query-interval?               uint16 <125>
       +--rw query-max-response-time?      uint8 <100>
       +--rw last-member-query-interval?   uint8 <10>
       +--rw robustness-variable?          uint8 <2>
       +--rw address-family* [address-family]
          +--rw address-family    identityref
          +--rw static-group* [group-addr source-addr]
             +--rw group-addr     ietf-routing-types:ip-multicast-group-address
             +--rw source-addr    ietf-inet-types:ip-address

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-11-06 03:41:59 -08:00
Mark Stapp ee2bbf7ce2 pimd: replace inet_ntoa
Replace all use of inet_ntoa, using %pI4 or inet_ntoa instead

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22 10:13:56 -04:00
Donatas Abraitis 2dbe669bdf :* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-22 09:07:41 +03:00
Renato Westphal 8b6b6b694d
Merge pull request #7222 from idryzhov/fix-debug
fix debug commands node inconsistencies
2020-10-09 21:58:24 -03:00
Adriano Marto Reis 9fbd9fc48f pimd: MSDP SA forwarding
* If the MSDP peer receives the SA from a non-RPF peer towards the
originating RP, it will drop the message.
* SA messages are forwarded away from the RP address only.
* SA messages are not forwarded within the mesh group.
* Preventing the MSDP connection from being dropped due to RPF check
failure (RFC3618, section 13 "MSDP Error Handling")

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
Signed-off-by: Adriano Reis <areis@barrukka.local>
2020-10-06 08:11:24 -04:00
Igor Ryzhov dd73744d8c *: move "show debugging ..." commands to enable node
Use the same node for "show debugging" commands in all daemons.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 15:06:05 +03:00
Donald Sharp d76c38ade3 pimd: Prevent Null string %s issues
There are couple spots where group may be NULL and
when we output strings associated with it we should
ensure we are not doing something stupid.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-18 09:46:06 -04:00
David Lamparter 3efd0893d0 *: un-split strings across lines
Remove mid-string line breaks, cf. workflow doc:

  .. [#tool_style_conflicts] For example, lines over 80 characters are allowed
     for text strings to make it possible to search the code for them: please
     see `Linux kernel style (breaking long lines and strings)
     <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_
     and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_.

Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'`
```

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14 10:37:25 +02:00
Quentin Young 007c1dd490
Merge pull request #6114 from rgirada/frr-static
pimd: Providing json support for few pim commands
2020-07-06 13:04:43 -04:00
rgirada 91c0fb4779 pimd: Modifying "show ip mroute json" o/p.
Description:
"show ip mroute" displays only installed(kernel) mroutes, where
as "show ip mroute json" diplays both installed and not installed
mroutes in the o/p.To make this consistant, diplaying only valid
routes in json o/p.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-05-30 05:15:43 -07:00
rgirada 922e754430 pimd: Providing json support for few pim commands.
Description:
Added json support for the following PIM commands.
1. show ip mroute [vrf NAME] count [json]
2. show ip mroute vrf all count [json]
3. show ip mroute [vrf NAME] summary [json]
4. show ip mroute vrf all summary [json]

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-05-30 05:15:27 -07:00
Donald Sharp 310885bdd8
Merge pull request #5881 from patrasar/2386420
pimd: add show ip multicast count [json] command
2020-05-26 09:21:10 -04:00
Sarita Patra 8c8d70319e pimd: add show ip multicast count [json] command
Added a new show command "show ip multicast", display the multicast data
packet in and out on interface level.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-05-05 00:27:47 -07:00
Donald Sharp 5d06e8a60e pimd: Add a needed space for formatting
Display a space in the output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-28 07:59:18 -04:00
David Lamparter c334a16ef1
Merge pull request #6262 from qlyoung/remove-sprintf 2020-04-23 20:27:26 +02:00
Donald Sharp bda96cdd33
Merge pull request #6126 from sarav511/watermark
pimd: Implement watermark warning for igmp group count and add igmp group count
2020-04-21 16:14:21 -04:00
Quentin Young 0880854185 pimd, lib: suppress compiler warnings on snprintf
truncation warnings on old compilers

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-21 13:13:06 -04:00
Quentin Young 772270f3b6 *: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
David Lamparter f4b8291fcb *: move CLI node names to cmd_node->name
And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:59 +02:00
David Lamparter 243895805a *: move CLI parent data to cmd_node->parent_node
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter 612c2c15d8 *: remove second parameter on install_node()
There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter 249a771b63 *: remove cmd_node->vtysh
The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter 62b346eefa *: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
Donald Sharp 950b395e8e
Merge pull request #6011 from patrasar/pim-no-msdp-group-cmd
pimd: added no ip msdp mesh-group <word>
2020-04-14 08:35:09 -04:00
Sarita Patra 34d86eff8e pimd: added no ip msdp mesh-group <word>
Issue: no ip msdp mesh-group <word> source command
deleting the mesh group, which might be used by the member.

Solution: no ip msdp mesh-group <word> source command, deletes
the mesh-group source.
Add a new cli command "no ip msdp mesh-group <word>" to delete
the mesh group.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-04-13 02:40:51 -07:00
saravanank 4d36096888 pimd: show ip igmp groups json output - Make group array for each interface
JSON output for igmp group display is modified as follows for better python handling.
1. Under each interface make array of group as an object
2. Include source and group inside each group object

These improvements are required for the set of topotest cases which will be upstreamed shortly.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-04-08 21:39:21 -07:00
saravanank 339f769530 pimd: Implement watermark warning for igmp group count and add igmp group count
This CLI will allow user to configure a igmp group limit which will generate
a watermark warning when reached.
Though watermark may not make sense without setting a limit, this
implementation shall serve as a base to implementing limit in future and helps
tracking a particular scale currently.

Testing:
=======

ip igmp watermark-warn <10-60000>

on reaching the configured number of group, pim will issue warning

2019/09/18 18:30:55 PIM: SCALE ALERT: igmp group count reached watermak limit: 210(vrf: default)

Also added group count and watermark limit configured on cli - show ip igmp groups [json]

<snip>

Sw3# sh ip igmp groups json
{
  "Total Groups":221,  <=====
  "Watermark limit":210, <=========
  "ens224":{
    "name":"ens224",
    "state":"up",
    "address":"40.0.0.1",
    "index":6,
    "flagMulticast":true,
    "flagBroadcast":true,
    "lanDelayEnabled":true,
    "groups":[
      {
        "source":"40.0.0.1",
        "group":"225.1.1.122",
        "timer":"00:03:56",
        "sourcesCount":1,
        "version":2,
        "uptime":"00:00:24"

<\snip>

<snip>

Sw3(config)# do sh ip igmp group
Total IGMP groups: 221
Watermark warn limit(Set) : 210
Interface        Address         Group           Mode Timer    Srcs V Uptime
ens224           40.0.0.1        225.1.1.122     ---- 00:04:06    1 2 00:13:22
ens224           40.0.0.1        225.1.1.144     ---- 00:04:02    1 2 00:13:22
ens224           40.0.0.1        225.1.1.57      ---- 00:04:01    1 2 00:13:22
ens224           40.0.0.1        225.1.1.210     ---- 00:04:06    1 2 00:13:22

<\snip>

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-04-08 21:39:13 -07:00
Quentin Young a5f610e474 pimd: fix BSM JSON keys
We use camelCase keys in FRR.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-05 23:54:12 -04:00
Quentin Young 4ad05982dc
Merge pull request #6080 from sarav511/buf_inc
pimd: increase buffer size for prefix str while printing bsrp-info
2020-03-24 12:29:47 -04:00
Russ White bb1cceed4a
Merge pull request #6024 from patrasar/mroute_reshape
pimd: re-shaping show ip mroute outout
2020-03-24 10:16:43 -04:00
saravanank 93a5bc8022 pimd: increase buffer size for prefix str while printing bsrp-info
Problem: output is cut short when prefix string all octets are 3 digit.
RCA: Buffer was allocated only to hold ip addr str.

Fix: Added 3 bytes more to hold prefix length and a /.
Modified buffer in 'show ip pim bsrp-info' and 'show ip pim bsm database'

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-24 00:24:56 -07:00
Donald Sharp a01f317b0f
Merge pull request #6008 from sarav511/max_vif
pimd: Do not allow to configure multicast on more than MAXVIF interfaces
2020-03-23 11:28:45 -04:00
Donatas Abraitis 2a7280e2e5
Merge pull request #5882 from patrasar/2386429
pimd: fix pim interface traffic & pim rp-info json command
2020-03-18 11:26:44 +02:00
Sarita Patra 5dff8b9dcf pimd: re-shaping show ip mroute outout
Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-17 21:44:20 -07:00
Russ White 09c04bc490
Merge pull request #5849 from donaldsharp/pim_register_prefix_list
Pim register prefix list
2020-03-17 14:57:10 -04:00
Donald Sharp 7967afda07
Merge pull request #5880 from patrasar/2371558
pimd: fix OIL not removed after IGMP prune
2020-03-17 13:40:53 -04:00
Donald Sharp fc74cbe76c
Merge pull request #5940 from patrasar/214257
pimd: add flags in show ip mroute command
2020-03-17 06:38:41 -04:00
Sarita Patra 9443810eef pimd: fix OIL not removed after IGMP prune
Issue: Client1------LHR-----(int-1)RP(int-2)------client2
Client2 send IGMP join for group G.
Client1 send IGMP join for group G.
verify show ip mroute in RP, will have 2 OIL.
Client2 send IGMP leave.
Verify show ip mroute in RP, will still have 2.

Root cause: When RP receives IGMP join from client2, it creates
a (s,g) channel oil and add the interface int-2 into oil list and
set the flag PIM_OIF_FLAG_PROTO_IGMP to int-2
Client1 send IGMP join, LHR will send a (*,G) join to RP. RP will
add the interface int-1 into the oil list of (s,g) channel_oil and
will set the flag PIM_OIF_FLAG_PROTO_IGMP and PIM_OIF_FLAG_PROTO_PIM
to the int-1 and set PIM_OIF_FLAG_PROTO_PIM to int-2 as well. It is
happening because of the pim_upstream_inherited_olist_decide() and
forward_on() get all the oil and update the flag wrongly.
So now when client 2 sends IGMP prune, RP will not remove the int-2
from oil list since both PIM_OIF_FLAG_PROTO_PIM & PIM_OIF_FLAG_PROTO_IGMP
are set, it just unset the flag PIM_OIF_FLAG_PROTO_IGMP.

Fix: Introduced new flags in if_channel, PIM_IF_FLAG_MASK_PROTO_PIM
& PIM_IF_FLAG_MASK_PROTO_IGMP. If a if_channel is created because of
pim join or pim (s,g,rpt) prune received, then set the flag
PIM_IF_FLAG_MASK_PROTO_PIM. If a if_channel is created becuase of IGMP
join received, then set the flag PIM_IF_FLAG_MASK_PROTO_IGMP.
When an interface needs to be added into the oil list check if
PIM_IF_FLAG_MASK_PROTO_PIM or PIM_IF_FLAG_MASK_PROTO_IGMP is set, then
update oil flag accordingly.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-16 21:54:34 -07:00
Sarita Patra a7a5472ef2 pimd: fix pim interface traffic & pim rp-info json command
Issue 1: "show ip pim interface traffic" not show prune TX/RX
Rootcause : not added the variable in the json
Fix : add prune TX/RX in show ip pim interface traffic json

Issue 2: "show ip pim rp-info" not shows the key iAmRp when it is false
Rootcause: Only display the key when the value is true.
Fix: add iAmRp as false in show ip pim rp-info json

Issue 3: "show ip pim rp-info" not showing outbound interface if it is empty
Rootcause: Only display when there is any OIL

Fix: When RP is not reachable then, the outbound interface is Unknown
The command "show ip pim rp-info json" not displaying the outbound
interafce if it is unknown

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-16 21:44:38 -07:00
Sarita Patra 6a42461973 pimd: add flags in show ip mroute command
S - Sparse Mode
C - indicates there is a member of the group directly connected to the router.
R -set on an (S, G) by the receipt of an (S, G) RP bit prune message.
F -This indicates that this router is a FHR and send register messages to RP to inform RP of this active source
P - OIL list is NULL. That means the router will send a prune.
T - At least one packet received via SPT.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-16 21:38:56 -07:00
saravanank ccf696e85f pimd: Do not allow to configure multicast on more than MAXVIF interfaces
RCA: When configured more than 32(MAXVIS), the inerfaces that are configured
after 32nd interfaces have the value of MAXVIF.
This is used as index to access the free vif tracker of array size 32(MAXVIFS).
So the channel oil list pointer which is present as the next field in pim structure get corrupt, when updating free vif.
This gets accessed during rpf update resulting in crash.

Fix: Refrain from allocating mcast interface structure and throw config error when more than MAXVIFS are attempted to configure.
Max vif checks are exempted for vrf device and pimreg as vrf device will be the first interface and not expected to fail and pimreg has reserved vif.
vxlan tunnel termination device creation has this check and throw warning on max vif.
All other creation are through CLI.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-16 19:49:18 -07:00
saravanank 36afe48622 pimd: show ip pim bsr json output - removing vtysh caption
Root cause: The header display is put in common outside the vtysh/json if-else.
Fix: Brought inside vtysh condition.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-15 18:58:53 -07:00
Russ White 7f6c322d50
Merge pull request #5839 from donaldsharp/upstream_merge
Upstream merge of missed MLAG code
2020-03-09 15:34:18 -04:00
Donald Sharp 5cb1323595
Merge pull request #5942 from patrasar/2438087
pimd: Display mroute uptime per (s,g) entry
2020-03-09 08:47:10 -04:00
Sarita Patra dfd12d0255 pimd: Display mroute uptime per (s,g) entry
Issue: show ip mroute displays the mroute uptime (time when
mroute installed into the kernel) per oif.
This is confusing.

Fix: Display mroute uptime per (s,g) mroute entry.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-09 00:30:34 -07:00
Donald Sharp f4e74bd038 pimd: Add ip pim register-accept-list PLIST command
When pim receives a register packet, we will apply the
received source to the prefix list.  If accepted normal
processing continues.  If denied we will send a register
stop message to the source.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 16:27:01 -05:00
Donald Sharp 1c4e26bc06 pimd: Rename the PIM_SPT_PLIST_NAME to PIM_PLIST_NAME
The memory type PIM_SPT_PLIST_NAME is specific to
SPT but we are going to store more prefix-list names
in pim, make it generic to allow for less confusion
in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 16:24:21 -05:00
Donald Sharp 17823cdd2c pimd: Add accidently missed code during upstreaming process
There was some code missed during the upstreaming process
due to code squash.  Identify and put into a commit
to keep code consistent and correct.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 16:02:52 -05:00
Donald Sharp 5e81f5dd1a *: Finish off the __PRETTY_FUNCTION__ to __func__
FINISH IT

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 09:23:22 -05:00
Donatas Abraitis 15569c58f8 *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
Just keep the code cool.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-05 20:23:23 +02:00
Russ White 30ac36dbfc
Merge pull request #5897 from patrasar/2415676
pimd: fix crash seen while executing igmp related configuration
2020-03-03 09:35:43 -05:00
Sarita Patra 4f007a5a03 pimd: fix crash seen while executing igmp related configuration
Issue 1:
1. Enable pim on an interface.
2. Configure query-interval or query max response time,
which results in pimd crash.

Root cause:
1. When pim is enabled on an interface, it creates a igmp socket
with querier_timer and other_querier time as NULL.
2. When query-interval/max_response_time is configured, it call the
function igmp_sock_query_reschedule() to reshedule the query. This
function check either of querier_timer or other_querier timer should
be running. Since in this case both are NULL, it results in crash.

Issue 2:
1. Enable pim on an interface.
2. Execute no ip igmp query-interval or query max response time,
which results in pimd crash.

Root cause:
1. When pim is enabled on an interface, it creates a pim interface
with querier_timer and other_querier time as NULL.
2. When no ip igmp query-interval/max_response_time is executed, it will
check either of querier_timer or other_querier timer should be running.
Since in this case both are NULL, it results in crash.

Fix:
When pim is enabled on an interface, it creates a igmp socket with
mtrace_only as true. So add a check if mtrace_only is true, then don't
reshedule the query.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-03 03:35:43 -08:00
Donald Sharp 7f5818fbd6 *: change hash_backet to hash_bucket
It's been a year search and destroy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-28 13:59:13 -05:00
Jafar Al-Gharaibeh 4d67e75282 Revert "*: change hash_backet to hash_bucket"
This reverts commit 3895c42a2e.

LabN CI update needs to be coordinated before merging this

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-02-27 09:52:02 -06:00
Donald Sharp 3895c42a2e *: change hash_backet to hash_bucket
It's been a year search and destroy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-26 20:03:34 -05:00
Mark Stapp 6c1b7a8c49 pimd: fix SA reports
Fix a couple of SA warnings introduced recently; replace some
'strcpy' calls.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-20 11:32:32 -05:00
Anuradha Karuppiah f80427e9e7 pimd: pim mlag show commands
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-14 09:18:30 -08:00
Anuradha Karuppiah 448139e704 pimd: stop overloading SRC_IGMP upstream for vxlan local membership
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-14 09:18:30 -08:00
Anuradha Karuppiah 05ca004b80 pim: DF election for tunnel termination mroutes in an anycast-VTEP setup
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-14 09:18:30 -08:00
Donatas Abraitis 975a328e2e *: Replace s_addr 0 => INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06 09:00:12 +02:00
Donald Sharp dd3364cb1a pimd: Convert the upstream_list and hash to a rb tree
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-03 08:39:55 -05:00
Donald Sharp 7315ecdabe pimd: Convert the channel_oil_list|hash to a rb_tree
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>
2020-01-03 08:39:55 -05:00
Jafar Al-Gharaibeh e57cc5f056 pimd: refactor ip mroute cmd
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-20 17:04:03 -06:00
Donald Sharp 4e29b89aba
Merge pull request #5427 from liam-mcb/igmp-join-any
pimd: Add command to join any-source multicast.
2019-12-16 07:47:41 -05:00
Liam McBirnie 771ce8ad24 pimd: Add command to join any-source multicast.
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-12 13:09:46 +01:00
Jafar Al-Gharaibeh 94c1ae82da
Merge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixes
PIM state machine fixes
2019-12-06 17:47:07 -06:00
Mark Stapp 07e123defc
Merge pull request #5328 from satheeshkarra/pim_mlag
pimd, lib, zebra : PIM MLAG Support
2019-11-22 08:51:47 -05:00
Anuradha Karuppiah 075a475e0c pimd: fixup whitespace errors reported by CI
No functional changes.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-20 13:32:08 -08:00
Donald Sharp 0f39cb4cb9 pimd: Create pimreg interface when we start any interface config
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-18 11:43:52 -05:00
Anuradha Karuppiah 8ff637c8c9 pimd: bring back "show ip pim upstream-join-desired"
It is now used to evaluate and display join-desired state for
each upstream entry -
root@spine-1:~# net show pim upstream-join-desired
Source          Group           EvalJD
*               239.1.1.111     yes
6.0.0.28        239.1.1.111     yes
6.0.0.29        239.1.1.111     no
6.0.0.30        239.1.1.111     yes

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah 5c9a72ef47 pimd: rename the upstream-join-desired command to "show ip pim channel"
This re-naming was needed because the JD state on an upstream is
not just based on channel info i.e. we can have JD=true even if there
is no downstream channel. The "show ip upstream-join-desired" command
will be changed to display that info i.e. upstream's JD state instead
of downstream channel params. The downstream channel params are now
available via "show ip pim channel"

PS: This change maybe reverted if upstream NAKs it. But there is a
pressing need for it to debug some not-so-reproduible problems.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah 60eb7e6b80 pimd: enforce PIM_ENFORCE_LOOPFREE_MFC at the time of MFC programming
This is needed for two reasons -
1. The inherited OIL needs to be setup independent of the RPF interface
to allow correct computation of the JoinDesired macro.
2. The RPF interface is computed at the time of MFC programming so
it is not possible to permanently evict the OIF at that time oif_add

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah 87b7cd5bc7 pimd: display the per-RPF neighbor join-prune agg list
root@leaf-12:~# vtysh -c "show ip pim jp-agg"
Interface        RPF Nbr         Source          Group           State
swp1             6.0.0.26        *               239.1.1.111         J
swp1             6.0.0.26        *               239.1.1.112         J
swp1             6.0.0.26        *               239.1.1.113         J
swp1             6.0.0.26        *               239.1.1.114         J
root@leaf-12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:08 -08:00
Anuradha Karuppiah 9929a2a9af pimd: display changes to indicate if a SG entry is still on the RPT
Sample output -
root@leaf-12:~# net show pim state
Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted
Active Source           Group            RPT  IIF               OIL
1      *                239.1.1.111      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.111      y    swp1
1      *                239.1.1.112      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.112      y    swp1
1      *                239.1.1.113      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.113      y    swp1
1      *                239.1.1.114      y    swp1              swp3( J   )
1      6.0.0.28         239.1.1.114      y    swp1
root@leaf-12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 12:00:29 -08:00
Anuradha Karuppiah 5923b7396e pimd: MUTE flag to suppress traffic forwarding on non-DF
If an mroute loses DF election (with the MLAG peer) it has to stop
forwarding traffic on active-active devices such as ipmr-lo used
for vxlan traffic termination. To acheive that this commit
introduces a concept of OIF muting. That way we can let the PIM and
IGMP state machines play out and silence OIFs after the fact.

Relevant outputs:
=================
1. muted OIFs are displayed with the M flag in "pim state" -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@TORC12:~# net show pim state |grep "27.0.0.13"|grep 100
1         27.0.0.13        239.1.1.100      uplink-1          ipmr-lo(   *M)
root@TORC12:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2. And supressed altogether in the mroute output -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@TORC12:~# net show mroute |grep "27.0.0.13"|grep 100
27.0.0.13       239.1.1.100     none   uplink-1         none             0    --:--:--
root@TORC12:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 09:16:15 -08:00
Satheesh Kumar K 36b5b98fef pimd : Add support for MLAG Register & Un-register
when ever a FRR Client wants to send any data to another node
using MLAG Channel, uses below mechanisam.

1. sends  a MLAG Registration to zebra with interested messages that
   it is intended to receive from peer.
2. In response to this request, Zebra opens communication channel with
   MLAG. and also in Rx. diretion zebra forwards only those messages which
   client shown interest during registration
3. when client is no-longer interested in communicating with MLAG, client
   posts De-register to Zebra
4. if this is the last client which is interested for MLAG Communication,
   zebra closes the channel.

why PIM Needs MLAG Communication
================================
1. In general on LAN Networks elecetd DR will send the Join towards
   Multicast RP in case of a LHR and Register in case of FHR.
2. But in case DR Goes down, traffic will be re-converged only after
   the New DR is elected, but this can take time based on Hold Timer to
   detect the DR down.
3. this can be optimised by using MLAG Mecganisam.
4. and also Traffic can be forwarded more efficiently by knowing the cost
   towards RP using MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-13 19:46:52 -08:00
Donald Sharp 3b13a2ccc1 pimd: Duplicate config is not a CMD_WARNING_CONFIG_FAILED
When you enter:
ip pim ssm prefix-list my-custom-ssm-range
ip pim ssm prefix-list my-custom-ssm-range

The second instance would cause a failure to happen which
should not happen w/ duplicate config.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-29 21:37:30 -04:00
Donald Sharp 253283d742 pimd: result was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBO
The result variable was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBO
earlier in the function.  No need to do the same thing twice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 07:07:49 -04:00
Quentin Young 6a597223d3 Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"
This reverts commit d563896dad, reversing
changes made to 09ea1a4038.
2019-10-14 17:15:09 +00:00
Satheesh Kumar K 4bf3dda597 pimd : Add support for MLAG Register & Un-register
when ever a FRR Client wants to send any data to another node
using MLAG Channel, uses below mechanisam.

1. sends  a MLAG Registration to zebra with interested messages that
   it is intended to receive from peer.
2. In response to this request, Zebra opens communication channel with
   MLAG. and also in Rx. diretion zebra forwards only those messages which
   client shown interest during registration
3. when client is no-longer interested in communicating with MLAG, client
   posts De-register to Zebra
4. if this is the last client which is interested for MLAG Communication,
   zebra closes the channel.

why PIM Needs MLAG Communication
================================
1. In general on LAN Networks elecetd DR will send the Join towards
   Multicast RP in case of a LHR and Register in case of FHR.
2. But in case DR Goes down, traffic will be re-converged only after
   the New DR is elected, but this can take time based on Hold Timer to
   detect the DR down.
3. this can be optimised by using MLAG Mecganisam.
4. and also Traffic can be forwarded more efficiently by knowing the cost
   towards RP using MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-09-16 20:11:01 -07:00
Quentin Young 33b58e536f pimd: fix some help strings
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-06 00:15:27 +00:00
Quentin Young 2951a7a4c2 *: s/TRUE/true/, s/FALSE/false/
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-01 17:26:05 +00:00
Rafael Zalamena 9b2d87406a
Merge pull request #4525 from donaldsharp/some_cleanups
Some cleanups
2019-06-25 16:06:57 -03:00
David Lamparter 18130847e6
Merge pull request #4520 from rgirada/fix_clear_mroute
pimd: Added cli to generate igmp query.
2019-06-25 14:06:13 +02:00
rgirada 6741a5bb4e pimd: Added cli to generate igmp query.
Fix details :
Added a utility cli to generate a igmp query on an interface.
This won't impact the existing query generation based on the
general query interval.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2019-06-24 03:15:10 -07:00
Donald Sharp a36898e755
Revert "Ospf missing interface handling 2" 2019-06-23 19:46:39 -04:00
Donald Sharp a12bb225a6
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
2019-06-22 13:35:45 -04:00
Donald Sharp 11884868d4 pimd: ALLOC functions cannot fail.
There is no need to check for ALLOC function failures
in the code base.  If we cannot get more memory we
assert.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-19 19:07:12 -04:00
David Lamparter 3779776a39 lib/clippy: error out on unsupported bits
clippy can't process #ifdef or similar bits inside of an argument list
(e.g. within the braces of a DEFUN or DEFPY statement.)  Improve error
reporting to catch these cases instead of generating broken C code.

Fixes: #3840
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12 19:22:59 +02:00
Philippe Guibert f11e98eca3 *: change if_lookup_by_name() api with vrf
the vrf_id parameter is replaced by struct vrf * parameter.
this impacts most of the daemons that look for an interface based on the
name and the vrf identifier.
Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was
ignored until now.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:54 +02:00
Russ White 51e6f92ec6
Merge pull request #4494 from donaldsharp/no_src_for_you
pimd: The PIM_OIF_FLAG_PROTO_SRC flag was never used
2019-06-11 08:13:04 -04:00
Donald Sharp 11e0acfba5 pimd: The PIM_OIF_FLAG_PROTO_SRC flag was never used
Nor should it be.  So remove from system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-08 07:30:36 -04:00
Donald Sharp 9a8a7b0ed1 lib, pimd, sharpd: Various output string cleanups
Various compilers in our CI system were complaining about various
auto-conversions.  Let's get these cleaned up a bit more.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-07 09:29:45 -04:00
Russ White 230dec1398
Merge pull request #4452 from donaldsharp/mroute_count
pim: Add `clear ip mroute [vrf NAME] count` command
2019-06-04 09:16:34 -04:00
Donald Sharp cd333cf968 pimd: Add clear ip mroute [vrf NAME] count command to pim
When debugging a large number of mroutes and data is changing
fast it is sometimes hard to know what has actually changed.
Add a `clear ip mroute count` command that resets the last
data points gathered and allows you to see what has changed
since the last clear.

Output:
donna.cumulusnetworks.com# show ip mroute count

Source          Group           LastUsed Packets Bytes WrongIf
*               224.0.1.60      272      0       0          0
10.50.11.11     239.255.255.250 2        1       203        1
10.50.11.13     239.255.255.250 66       1       203        1
10.50.11.100    239.255.255.250 68       1       203        1
10.50.11.114    239.255.255.250 62       2       406        1
10.50.11.129    239.255.255.250 10       1       199        1
10.50.11.143    239.255.255.250 44       1       203        1
10.50.11.144    239.255.255.250 44       1       203        1
10.50.11.156    239.255.255.250 66       1       203        1
10.50.11.235    239.255.255.250 149      0       0          0
10.50.11.246    239.255.255.250 54       5       965        1
donna.cumulusnetworks.com# clear ip mroute count
donna.cumulusnetworks.com# show ip mroute count

Source          Group           LastUsed Packets Bytes WrongIf
*               224.0.1.60      279      0       0          0
10.50.11.11     239.255.255.250 9        0       0          0
10.50.11.13     239.255.255.250 73       0       0          0
10.50.11.100    239.255.255.250 76       0       0          0
10.50.11.114    239.255.255.250 69       0       0          0
10.50.11.129    239.255.255.250 17       0       0          0
10.50.11.143    239.255.255.250 51       0       0          0
10.50.11.144    239.255.255.250 51       0       0          0
10.50.11.156    239.255.255.250 73       0       0          0
10.50.11.235    239.255.255.250 156      0       0          0
10.50.11.246    239.255.255.250 61       0       0          0
donna.cumulusnetworks.com# show ip mroute count

Source          Group           LastUsed Packets Bytes WrongIf
*               224.0.1.60      300      0       0          0
10.50.11.11     239.255.255.250 30       0       0          0
10.50.11.13     239.255.255.250 94       0       0          0
10.50.11.100    239.255.255.250 96       0       0          0
10.50.11.114    239.255.255.250 90       0       0          0
10.50.11.119    239.255.255.250 7        1       203        1
10.50.11.127    239.255.255.250 3        2       406        1
10.50.11.129    239.255.255.250 38       0       0          0
10.50.11.143    239.255.255.250 72       0       0          0
10.50.11.144    239.255.255.250 72       0       0          0
10.50.11.156    239.255.255.250 94       0       0          0
10.50.11.197    239.255.255.250 2        1       200        1
10.50.11.235    239.255.255.250 177      0       0          0
10.50.11.246    239.255.255.250 82       0       0          0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 11:16:00 -04:00
Donald Sharp fbd74c7d94 pimd: Convert strncpy to strlcpy in pim_cmd.c
A couple of places of strncpy snuck in due to my confusion
about if Quentin's earlier change had gotten in.  Just some
code in flux.  This should fix the issue/warnings in our
CI system.
2019-06-03 10:09:22 -04:00
Donald Sharp ed7e15589d pimd: Remove unused functions
Recent commits rewrote the `clear mroute` command and this caused
these two two functions to no longer be used, remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 08:38:38 -04:00
Donald Sharp b97480c548
Merge pull request #4274 from rgirada/fix_clear_mroute
pimd: Re-deisgn the "clear ip mroute" command.
2019-06-03 07:39:04 -04:00
Donald Sharp 008def8643
Merge pull request #4369 from patrasar/lmqc_lmqt
pimd: new cli to configure last-member-query-count & last-member-quer…
2019-05-30 21:23:11 -04:00
Sarita Patra 59115451a8 pimd: new cli to configure last-member-query-count & last-member-query-interval
Introduce new cli commands ip igmp last-member-query-count <1-7>
ip igmp last-member-query-interval <1-255> deciseconds.

Display the config in show running config and show ip igmp interface

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-05-29 20:36:16 -07:00
Renato Westphal 0ad79902fc
Merge pull request #4267 from qlyoung/fix-misc-compile-warnings
Fix misc compile warnings, remove strcpy & strcat
2019-05-29 23:55:17 -03:00
Quentin Young c35b7e6bea pimd: strcpy -> strlcpy
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-29 18:03:26 +00:00
Sarita Patra 468b6f4400 pimd: new cli command show ip mroute summary
Introduced a new command "show ip mroute summary"
to display total number of (*, G) and (S, G) mroutes
created and number of mroutes installed in the kernel.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-05-29 08:44:22 -07:00
rgirada 4a5e6e7416 pimd: Re-deisgn the "clear ip mroute" command.
Made changes to clean up the all upstreams and ifchannels
in FRR apart from cleanup datapath mroutes when this command
issued.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2019-05-28 22:39:32 -07:00
Jafar Al-Gharaibeh bda0241599
Merge pull request #4239 from sarav511/rp
pimd: PIM Bootstrap Message Processing
2019-05-28 10:26:28 -05:00
saravanank 5164ad1e98 pimd: clear pim bsm traffic counters for BSM
Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank 415f63501b pimd: Implement show & clear ip pim statistics command
This would show only bsm related statistics for now.
We shall add more statistics to this later.

Sw3# show ip pim statistics
BSM Statistics :
----------------
Number of Received BSMs : 1584
Number of Forwared BSMs : 793
Number of Dropped BSMs  : 1320

Interface : ens192
-------------------
Number of BSMs dropped due to config miss : 0
Number of unicast BSMs dropped : 0
Number of BSMs dropped due to invalid scope zone : 0

Interface : ens224
-------------------
Number of BSMs dropped due to config miss : 0
Number of unicast BSMs dropped : 0
Number of BSMs dropped due to invalid scope zone : 0

Interface : ens256
-------------------
Number of BSMs dropped due to config miss : 0
Number of unicast BSMs dropped : 0
Number of BSMs dropped due to invalid scope zone : 0

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank 321295c1d7 pimd: Implementation of show ip pim bsrp-info.
This command displays the group to rp mappings received from BSR.

Sw3# show ip pim bsrp-info
BSR Address  30.0.0.100
Group Address 225.1.1.1/32
--------------------------
Rp Address      priority        Holdtime        Hash
(ACTIVE)
20.0.0.2        0               150             1533588312
2.2.2.2         0               150             1524600152
9.9.9.10        0               150             1489835248
7.7.2.7         0               150             1230207135
7.2.2.7         0               150             1093826719
7.7.9.7         0               150             897086367
7.8.9.10        0               150             811603184
7.5.2.7         0               150             746158239
9.10.9.10       0               150             658117872
(PENDING)
Pending RP count :0
Partial List is empty.

Group Address 226.1.1.1/32
--------------------------
Rp Address      priority        Holdtime        Hash
(ACTIVE)
9.9.9.9         0               150             326773161
(PENDING)
Pending RP count :0
Partial List is empty.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank 0d1a4e24c2 pimd: Implement show ip pim bsm-database
This command shows all the fragments of the last received preferred BSM.
This displayed in readable format.

Sw3# sh ip pim bsm-database
Scope Zone: Global
Number of the fragments: 1

BSM Fragment : 1
------------------
BSR-Address     BSR-Priority    Hashmask-len    Fragment-Tag
30.0.0.100      0               0               3289

Group : 225.1.1.1/32
-------------------
Rp Count:9
Fragment Rp Count : 9
RpAddress     HoldTime     Priority
20.0.0.2        150          0
2.2.2.2         150          0
9.9.9.10        150          0
7.7.2.7         150          0
7.2.2.7         150          0
7.7.9.7         150          0
7.8.9.10        150          0
7.5.2.7         150          0
9.10.9.10       150          0

Group : 226.1.1.1/32
-------------------
Rp Count:1
Fragment Rp Count : 1
RpAddress     HoldTime     Priority
9.9.9.9         150          0

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank 256392ebfd pimd: Implementation of show ip pim bsr command
Command to display current bsr, last received bsm ts, bsr uptime

Sw3# sh ip pim bsr
PIMv2 Bootstrap information
Current preferred BSR address: 30.0.0.100
Priority        Fragment-Tag       State           UpTime
  0               6390            ACCEPT_PREFERRED    91:26:24
Last BSM seen: 00:00:37

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:37:27 -07:00
saravanank d0e418b42c pimd: rp_new & rp_del split into 2 tier functions & implement rp_change
pim_rp_new split into pim_rp_new_config and pim_rp_new.
pim_rp_new_config is called by CLI.
pim_rp_new will be called by pim_rp_new_config and bsm rp config.

pim_rp_del is split into pim_rp_del_config and pim_rp_del
pim_rp_del_config is called by CLI.
pim_rp_del is called by pim_rp_del_config and bsm rp config

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:35:45 -07:00
saravanank 16c926c85d pimd: interface commands to enable/disable bsm processing
(intf)ip pim bsm - to enable bsm processing on the interface
(intf)no ip pim bsm - to disable bsm processing on the interface
(intf)ip pim unicast-bsm - to enable ucast bsm processing on the interface
(intf)no ip pim unicast-bsm - to disable ucast bsm processing on the interface

Note: bsm processing and ucast bsm processing is enabled by default on a
pim interface. The CLI is implemented as a security feature as recommended by
RFC 5059

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 20:23:15 -07:00
saravanank 4616b2e981 pimd: cli changes to show BSM statistics in show ip pim int traffic
Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 20:23:15 -07:00
saravanank 09524ccfb0 pimd: implement debug pim bsm command
Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 20:23:15 -07:00
Donald Sharp 859ea2dea0 pimd: Stop crash in show of single interface
There exists a possiblity that we have upstream data but
at this point in time the rpf failed because there is no
path.  As such the rpf interface will be NULL and we
should not necessarily trust it.  Prevent a crash

Ticket: CM-24857
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-02 10:37:04 -04:00
Donald Sharp e134b399bd pimd: Add missing flags to json output
the json code has not been updated since a variety of new flags have
been added to the code base.  Add those flags in so we can tell
what is going on sometimes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-23 22:01:44 -04:00
Donald Sharp c23c1d3957 pimd: Add ability to select on S or G for show ip mroute
Add the ability to select on a S or G for a `show ip mroute`
command.

show ip mroute 225.1.1.111
show ip mroute 4.5.6.7 225.1.1.111

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-22 19:51:20 -04:00
Jafar Al-Gharaibeh c6f637132f
Merge pull request #4025 from AnuradhaKaruppiah/pim-evpn
pim-evpn: Forwarding overlay BUM traffic via multicast VxLAN tunnels in the underlay
2019-04-22 11:44:52 -05:00
Anuradha Karuppiah 7c85225cf5 pimd: hidden command to set MLAG parameters
The MLAG component on the switch is expected to provide some
properties (such as peerlink-rif) to bootstrap the anycast-VTEP
functionality. The final interface for this is being defined as
a part of the pim-mlag functionality.

This commit provides a hidden command to test the anycast-VTEP
functionality independent of the MLAG component.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:23 -07:00
Anuradha Karuppiah f1e2901a0f pimd: display commands for the pim-vxlan-sg database and worklist
Sample output:
root@TORS1:~# vtysh -c "show ip pim vxlan-groups"
Codes: I -> installed
Source          Group           Input           Output          Flags
27.0.0.7        239.1.1.101     lo                              I
*               239.1.1.100     -               ipmr-lo         I
*               239.1.1.101     -               ipmr-lo         I
27.0.0.7        239.1.1.100     lo                              I
root@TORS1:~#

root@TORS1:~# vtysh -c "show ip pim vxlan-work"
Codes: I -> installed
Source          Group           Input           Flags
27.0.0.7        239.1.1.100     lo                              I
PS: note the worklist dump is a hidden command

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:23 -07:00
Anuradha Karuppiah 4d913fa62e pimd: cli changes for pim-debug-vxlan
Sample:
root@TORC12:~# vtysh -c "show run" |grep "debug pim vxlan"
debug pim vxlan
root@TORC12:~# vtysh -c "show debug" |grep "pim vxlan"
debug pim vxlan
root@TORC12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:23 -07:00
Anuradha Karuppiah b1891fa084 pimd: API for enabling pim on the vxlan term device ipmr-lo
ipmr-lo is a dummy netdev with no additional addressing requirements -
root@TORS1:~# ip -d link show ipmr-lo
28: ipmr-lo: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 12:5a:ae:74:51:a2 brd ff:ff:ff:ff:ff:ff promiscuity 0
    dummy addrgenmode eui64
root@TORS1:~#

This device is used by pim-vxlan to signify multicast-vxlan-tunnel
termination.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:21 -07:00
Anuradha Karuppiah ee31c9fd1a pimd: add new OIF type in prep for vxlan support
In an anycast VTEP setup the peerlink-rif (ISL) is added as a OIF to the
tunnel origination mroute. A new OIF protocol, VxLAN, has been added to
allow that functionalty.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:21 -07:00
Donald Sharp 6de45bcc61 pimd: Add ability to select join S,G for 'show ip pim join`
Add a bit of code to allow us to look at specified S,G for
the upstream available to us.

If one item is listed we assume Group, if both we assume Source
then Group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-18 16:36:10 -04:00
Donald Sharp dff5cedb56 pimd: Add ability to select upstream on S,G for show ip pim upstream
Add a bit of code to allow us to look at specified S,G for
the upstreams available to us.

If one item is listed we assume Group, if both we assume Source then
Group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-18 16:36:10 -04:00
Russ White 0697abef9d
Merge pull request #4096 from donaldsharp/pim_nht_cleanup
Pim nht cleanup
2019-04-16 10:27:35 -04:00
Mark Stapp 35a1272051 pimd: use debug pim static
Replace cli 'debug static' with 'debug pim static', to make
the 'debug static' node available for staticd (eventually).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-11 11:46:40 -04:00
Donald Sharp 43763b11d0 pimd: Tracking of RPF is *separate* from the lookup
Start the separation of tracking a Destination from the act
of looking it up.  The cojoining of these two concepts led
to a bunch of code that had to think about both problems leading
to weird situations and code paths.  Simplify the code by making
pim_ecmp_nexthop_search a static function and we only ever
call pim_ecmp_nexthop_lookup when we need to do a RPF().

pim_ecmp_nexthop_lookup will now attempt to find a stored pnc
and if it finds one it will report on the answer from it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-05 11:12:59 -04:00
Lou Berger e9890df15d
Merge pull request #4073 from donaldsharp/undebug_me_or_not
some cleanup across multiple daemons
2019-04-04 10:08:34 -04:00
Jafar Al-Gharaibeh dbf2f94c2c
Merge pull request #4060 from donaldsharp/pim_cherrybomb
Pim cherrybomb
2019-04-03 23:02:32 -05:00
Donald Sharp fb09579ef7 bgpd, pimd: Remove undebug commands
The undebug XXX commands were deprecated over a year ago now,
time to nuke from on high.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-03 16:17:26 -04:00
Donald Sharp ade155e146 pimd: pim_nexthop_lookup should return true/false
The current reverse logic led to this code construct
if (!pim_nexthop_lookup(...)) {
	//Do something successfull
}

This is backwards and will cause logic errors when people
use this code.  Fix to use true/false for success/failure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-02 08:20:36 -04:00
Sarita Patra e7cd85bda7 pimd: Introduce mroute_creation in channel oil data structure
Issue: (*,G) mroute uptime is not updated in mroute table,
after deleting and adding the RP

Root cause: When RP gets deleted or becomes not reachable, then
we un-install the entry from the kernel, but still maintains the
entry in the stack. When  RP gets re-configured or becomes reachable,
"show ip mroute" shows the uptime, when the channel_oil gets created.

Fix: Introduce a new time mroute_creation in the channel_oil, gets
updated when mroute gets installed in the kernel.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-03-31 23:38:28 -07:00
Donald Sharp ff415346e6 pimd: Interfaces can be upto 16 characters
The interface column in pim was limited to 8 or 9 columns
all over the place in pim, fix the code up to allow interface
length to be up to 16 columns.

Ticket: CM-23083
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-26 21:01:00 -04:00
Donald Sharp a6170d839a
Merge pull request #3863 from patrasar/RP_addition_deletion_changes
Rp addition deletion changes
2019-03-20 18:31:01 -04:00
Donald Sharp f116689efb pimd: Display drpriority as a unsigned int
There existed output code that used %d for a uint32_t
switch to a %u.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-15 11:32:41 -04:00
David Lamparter 6e727402bd
Merge pull request #3907 from donaldsharp/pim_election
pimd: Ensure DR election happens when both sides change prio
2019-03-11 19:41:10 +01:00
Donald Sharp 3de708125e pimd: Ensure DR election happens when both sides change prio
Suppose we have 2 routers A and B.  Both Router A and B have
the same priority of 1000.  Router A is the elected DR.
Now suppose B lowers his priority to 1.  He still looses the
DR election and we are not sending a hello with the new priority.
Immediately after this A's priority is also lowered to 1, it
looses the election and sends the hello.  B receives this hello
and elects A as the DR( since it has the better ip address)
At this point A believes B is the DR, and B believes A is the
DR until such time that the normal hello from B is sent to A,
which if timed correctly can be a significant amount of time).

This code just causes a hello to be sent if the priority is
changed.  Now both sides will be able to converge quickly

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-05 10:29:35 -05:00
Quentin Young 0a22ddfbb1 *: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:46 +00:00
Tim Bray e3b78da875 *: Rename backet to bucket
Presume typo from original author

Signed-off-by: Tim Bray <tim@kooky.org>
2019-02-25 16:22:36 +00:00
Sarita Patra d8bed89dca pimd: Handling dummy upstream in "show ip pim upstream"
When FRR receives IGMP/PIM (*, G) join and RP is not configured or
not reachable, then we are creating a dummy upstream with incoming
interface as NULL.
Added some null checks for the incoming interface, while displaying
the pim upstream information in the cli command "show ip pim upstream".

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-24 09:38:03 -08:00
Donald Sharp 70fd22bd03 pimd: Add 'test pim keepalive-reset A.B.C.D A.B.C.D' command
Add a test command to pim that allows you to reset the keepalive timer
for an upstream to it's max value.  This is to allow purposeful testing
of cleanup code in pim, by forcing the keeaplive timer to expire later.

robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:10 00:00:52  00:00:25  00:02:54       1
robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:11 00:00:51  00:00:24  00:02:53       1
robot# test pim keep 192.168.201.136 225.1.0.0
Setting (192.168.201.136,225.1.0.0) to current keep alive time: 210
robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:27 00:00:35  00:00:08  00:03:27       1
robot#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-20 19:26:05 -05:00
Sarita Patra 6b44b40141 pimd: reject inconsistent address/mask "ip pim rp command"
Issue: Configure "ip pim rp x.x.x.x 225.0.0.0/4".
Show running config shows "ip pim rp x.x.x.x 224.0.0.0/4"
This is mis-leading.

Root-cause: Internally 225.0.0.0/4 is getting converted to
224.0.0.0/4 group mask, since the prefix length is 4.

Fix: Restrict the user to configure inconsistent group address
mask by throughing a cli error "Inconsistent address and mask".

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-08 01:35:21 -08:00
Donald Sharp 414d885aac pimd: Add hidden 'ip pim active-active` command
Add a command to track if an interface should be in active-active
mode or not.  This command is hidden at this time because it
is not finished fully.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-31 09:28:39 -05:00
Donald Sharp afec9bba1e pimd: Allow pim to display what it believes the mlag role is.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:40 -05:00
Donald Sharp 75373ccac4 pimd: Move packet_process variable to pim_router
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp 2925dff513 pimd: Move register_suppress_time into struct pim router
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp da03883e1e pimd: Convert rpf_cache_refresh_delay_msec into pim_router struct
Move the rpf_cache_refresh_delay_msec into the pim_router since
it should own the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp 5b45753eff pimd: Convert qpim_t_periodic into the struct pim_router structure
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp a0bf54c7de pimd: Add some extra information to a show command
The tracking of who have drpriority on an interface
in pim was not displayed anywhere.  Add to the show
command for future reference.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-21 10:17:48 -04:00
Donald Sharp 85a13586ed pimd: use bool instead of int to pass true/false
In pim_if_new use bool instead of an int to pass
true/false values for what we should create the
pim interface type for.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-17 14:09:06 -04:00
Donald Sharp 59752d4ea5 pimd: Actually create vif's in non-integrated config
The startup of a non-integrated config was not properly
allowing for startup to create the vif when we have
not learned about the interface we are trying to configure
at this point in time.  Actually notice when we are
trying to create a pimreg device or not to properly
notice when to attempt to create the vif or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-17 13:58:59 -04:00
Sarita Patra eccdcfe2b6 pimd: fix indentation warnings
Signed-off-by: Sarita Patra <saritap@vmware.com>
2018-09-11 22:00:15 -07:00
root 2f5e937c49 pimd: create a new command "ip pim" configuring pim sm
A new command "ip pim" is created to configure pim sm on an
interface, which replaces the existing commands "ip pim sm"
and "ip pim ssm" and make "ip pim sm" and "ip pim ssm" as
hidden commands. The command "ip multicast-routing" is removed
since it is already enabled on FRR by default.

Signed-off-by: Sarita Patra saritap@vmware.com
2018-09-10 22:22:14 -07:00
Don Slice 088f109866 bgpd, ospfd, pimd, zebra: Convert more use_json locations to bool
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-09-04 17:39:04 +00:00
Don Slice 9f049418bc bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined.  This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output.  Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.

Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 12:40:18 +00:00
David Lamparter a2dc7057e0 *: fix gcc-8 format-overflow warnings
e.g.
pimd/pim_oil.c: In function ‘pim_channel_oil_dump’:
pimd/pim_oil.c:51:19: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]

Build on gcc-8.2.0 is warning-free after this patch.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-21 21:05:09 +02:00