Commit Graph

2572 Commits

Author SHA1 Message Date
sarita patra
fd3eb43d76 pimd: Disable receiving BSM on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
c473c7452a pimd: Disable receiving assert msg on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
b9695c6d04 pimd: Disable receiving join/prune on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
1e8f260cd4 pimd: Disable receiving register-stop on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
b4afc283e9 pimd: Disable receiving register msg on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
39c2130e82 pimd: Disable receiving hello on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
11e771be61 pimd: Handling hello send statistics for passive interface
Increment pim_ifstat_hello_sent only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
6dd493b80b pimd: Handling reg and reg_stop send statistics for passive interface
Increment pim_ifstat_reg_stop_send & pim_ifstat_reg_send when
interface is passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
2287056228 pimd: Handling Join/Prune statistics for passive interface
Increment pim_ifstat_prune_send only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
ac5c9346b7 pimd: Handling BSM send statistics for passive interface
Increment pim_ifstat_bsm_tx only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
51660af8ff pimd: Handling assert send statistics for passive interface
Increment pim_ifstat_assert_send only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
7be33c5b4a pimd: display passive in show ip pim interface cmd
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
2a66cf6309 pimd: show ip[v6] pim passive in show running config
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
03c106bf30 pimd: Disable sending of control packets on passive interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
78039cb25d pimd: introduced flags for pim_passive_enable
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
51491fdc13 pim6d: introduce ipv6 pim passive command
Added a new cli command "ip pim passive" in the interface context,
to disable sending of pim control packets on the interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
sarita patra
d017bf3cb0 pimd: introduce ip pim passive command
Added a new cli command "ip pim passive" in the interface context,
to disable sending of pim control packets on the interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:50:06 -07:00
Donatas Abraitis
6006b807b1 *: Properly use memset() when zeroing
Wrong: memset(&a, 0, sizeof(struct ...));
    Good:  memset(&a, 0, sizeof(a));

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-11 14:08:47 +03:00
David Lamparter
df655593a2 pim6d: change MLD socket to be per VRF
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter
d2951219a1 pim6d: add some show commands for MLD
Just some basic show commands to get going.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter
5afe22f5bc pim6d: show MLD in running-config
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter
aa2f934929 pim6d: count stats for MLD
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter
5e5034b0a2 pim6d: add fresh MLD implementation
Fresh ground-up MLD implementation with subscriber-tracking for MLDv2.
Intended to be adapted for IPv4 and replace the IGMP implementation at a
later point.

Tested in ANVL, currently at 94/116.  Some issues/TODOs are left in the
code as CPP_NOTICE markers, but the code is very much good enough to
proceed since otherwise we're blocked on overall PIM v6 progress.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:01:59 +02:00
David Lamparter
993e3d8e13 pimd: un-dependency-hell pim_instance.h
This is causing build issues on BSD by including (transitively)
`linux/mroute6.h` - try to address by disentangling the headers a bunch.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 15:10:57 +02:00
David Lamparter
1b00ed5f65 pimd: pass down length for register messages
The IPv6 `mrt6msg` kernel pseudo-header does not have a length field;
accessing what would be the IPv6 payload length reads zeroes.

Pass down the proper length and use that instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 12:42:29 +02:00
Donatas Abraitis
50f1f2e724
Merge pull request #11059 from anlancs/fix/bgpd-evnp-wrong-check-hashget
bgpd: fix memory leak for evpn
2022-05-04 21:19:51 +03:00
Rafael Zalamena
8bc5979049
Merge pull request #11142 from patrasar/pim_register_show_fix
pimd: fixing wrong diplay registerTx
2022-05-03 17:01:30 -03:00
sarita patra
007784ccff pimd: fixing wrong diplay registerTx
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-03 08:53:47 -07:00
Donald Sharp
53f60d5d5b
Merge pull request #11113 from opensourcerouting/pim6-icmp6-replace-bpf
pim6d: use ICMP6_FILTER instead of BPF on mroute
2022-05-02 13:19:47 -04:00
anlan_cs
8e3aae66ce *: remove the checking returned value for hash_get()
Firstly, *keep no change* for `hash_get()` with NULL
`alloc_func`.

Only focus on cases with non-NULL `alloc_func` of
`hash_get()`.

Since `hash_get()` with non-NULL `alloc_func` parameter
shall not fail, just ignore the returned value of it.
The returned value must not be NULL.
So in this case, remove the unnecessary checking NULL
or not for the returned value and add `void` in front
of it.

Importantly, also *keep no change* for the two cases with
non-NULL `alloc_func` -
1) Use `assert(<returned_data> == <searching_data>)` to
   ensure it is a created node, not a found node.
   Refer to `isis_vertex_queue_insert()` of isisd, there
   are many examples of this case in isid.
2) Use `<returned_data> != <searching_data>` to judge it
   is a found node, then free <searching_data>.
   Refer to `aspath_intern()` of bgpd, there are many
   examples of this case in bgpd.

Here, <returned_data> is the returned value from `hash_get()`,
and <searching_data> is the data, which is to be put into
hash table.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-05-03 00:41:48 +08:00
mobash-rasool
de416e6782
Merge pull request #10742 from plsaranya/pim_register
pim6d: Register message send handling
2022-05-02 13:16:03 +05:30
David Lamparter
46a3bfa695
Merge pull request #10988 from AbhishekNR/ipv6_mroute_cli 2022-04-29 10:23:37 +02:00
mobash-rasool
c4aa8aa669
Merge pull request #11114 from opensourcerouting/vrf-declvar-macros
lib, zebra, pimd: clean up/fix VRF DECLVAR macros
2022-04-29 13:53:08 +05:30
plsaranya
30b277e158 pim6d: Register message send handling
Register and Null register send handling
In IPv6 PIM Null Register message if dummy PIM Header is included as
data, this dummy PIM header checksum needs to be valuated

Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-04-29 11:05:57 +05:30
sarita patra
53749ba70b pimd: Print secondary address using %pFX
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-28 03:28:17 -07:00
sarita patra
d58395d1f3 pim6d: Adjust IPV6 secondary address list
Within one Address List Hello option, all the addresses MUST be of
the same address family.  It is not permitted to mix IPv4 and IPv6
addresses within the same message.  In addition, the address family
of the fields in the message SHOULD be the same as the IP source and
destination addresses of the packet header.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-28 03:27:42 -07:00
Mobashshera Rasool
0696c2ff20 pim6d: Make pim_zlookup_sg_statistics available for v6
Since pim_zlookup.c is available for pimv6,
Call pim_zlookup_sg_statistics api for v6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-28 02:40:56 -07:00
Abhishek N R
74e8197b33 pim6d: Implementing "show ipv6 mroute summary" CLI
Adding new show CLI to display ipv6 mroute summary information.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-28 02:14:49 -07:00
Abhishek N R
c41a9dcfa2 pim6d: Implementing "show ipv6 mroute count" CLI
Adding new show CLI to display ipv6 mroute count information.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-28 02:14:49 -07:00
Abhishek N R
50ba39bf4c pim6d: Implementing "show ipv6 mroute" CLI
Adding new show CLI to display ipv6 mroute information.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-28 02:14:48 -07:00
David Lamparter
0cbed9511a lib, zebra, pimd: clean up/fix VRF DECLVAR macros
There's a common pattern of "get VRF context for CLI node" here, which
first got a helper macro in zebra that then permeated into pimd.

Unfortunately the pimd copy wasn't quite adjusted correctly and thus
caused two coverity warnings (CID 1517453, CID 1517454).

Fix the PIM one, and clean up by providing a common base macro in
`lib/vty.h`.

Also rename the macros (add `_VRF`) to make more clear what they do.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-28 11:09:26 +02:00
David Lamparter
fef295d439 pim6d: use ICMP6_FILTER instead of BPF on mroute
The ICMP6_FILTER option is always checked by the kernel, so the cost is
taken whether or not anything is set there.  Use it instead of taking on
additional cost with a BPF program.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-28 10:46:57 +02:00
Abhishek N R
3b767e4b6d pimd: Moving the common functions from pim_cmd.c
Moving the functions that are used by both IPV4 and IPV6 to a
common file pim_cmd_common.c file

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-28 01:43:19 -07:00
Mobashshera Rasool
51f4fd9810 zebra, pimd: Add a field family in the message ZEBRA_IPMR_ROUTE_STATS
1. Adding a field family in the existing ZEBRA_IPMR_ROUTE_STATS
to get the ipv4 as well as ipv6 trafic stats between pim and zebra.
2. Modify the debug to print both v4/v6 prefixes

pimd: pim6d: Modify pim_zlookup_sg_statistics to get ipv6 stats

Modify the pim_zlookup_sg_statistics api to
get ipv4/ipv6 stats from zebra. Making the api
common.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-28 01:10:49 -07:00
David Lamparter
633a50d11c
Merge pull request #11031 from AbhishekNR/v6_multicast 2022-04-28 10:06:00 +02:00
Donald Sharp
b6f754f89d
Merge pull request #11098 from opensourcerouting/zapi-mrib-v6
zebra, pimd: add IPv6 support to NEXTHOP_LOOKUP_MRIB
2022-04-27 09:27:49 -04:00
Abhishek N R
3e55b3b5fd pim6d: Implementing "show ipv6 multicast count" CLI
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-27 04:26:35 -07:00
Abhishek N R
ca3b5906fc pim6d: Implementing "show ipv6 multicast" CLI
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-27 04:25:51 -07:00
mobash-rasool
27562f3815
Merge pull request #11088 from opensourcerouting/pim-debug-snafus
pimd: fix SNAFUs in debug flags
2022-04-26 21:05:50 +05:30
David Lamparter
6f4ce28aa5 pimd: clean up zlookup nexthop handling
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-26 16:15:00 +02:00
David Lamparter
dea337dc57 pim6d: implement/un-stub MRIB lookup
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-26 16:15:00 +02:00
David Lamparter
34ee41c6c9 zebra, pimd: add AF param on NEXTHOP_LOOKUP_MRIB
By changing this API call to use a `struct ipaddr`, which encodes the
type of IP address with it.  (And rename/remove the `IPV4` from the
command name.)

Also add a comment explaining that this function call is going to be
obsolete in the long run since pimd needs to move to proper MRIB NHT.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-26 16:15:00 +02:00
Abhishek N R
be126d919a pimd: Moving the common functions from pim_cmd.c
Moving the functions that are used by both IPV4 and IPV6 to a
common file pim_cmd_common.c file

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-26 07:02:58 -07:00
David Lamparter
d1b7dfbe08
Merge pull request #10712 from patrasar/pim_nexthop_prefix_to_pimaddr 2022-04-26 15:39:36 +02:00
David Lamparter
e9c59240f6 pimd: add missing debug igmp trace detail
The flag was defined but there was no command to actually enable it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-26 10:49:03 +02:00
David Lamparter
92fed03c3d pimd: fix reversed logic for "debug ... detail"
The normal flag was enabling detail messages, but what we want is the
detail flag enabling normal messages.

Remove the _ONLY macro while at it, it's only used for config print &
that seems like a place where making the difference explicitly visible
is helpful regardless.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-26 10:49:03 +02:00
Sai Gomathi N
fb0054120d pim6d: Modifying the mld group watermark command name
Modifying the "mld_group_watermark_cmd" to "ipv6_mld_group_watermark_cmd"
and "igmp_group_watermark_cmd" to "ip_igmp_group_watermark_cmd" for consistency.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-24 23:44:27 -07:00
Sai Gomathi N
22532615b1 pim6d: Removing duplicate PIM_DECLVAR_CONTEXT macro
Removing the duplicate PIM_DECLVAR_CONTEXT from
pim_common_cmd.h file.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-24 23:44:27 -07:00
Mobashshera Rasool
14c7ac504f pimd: Set new to true in igmp_get_source_by_addr api
5421bf8 commit forgot to set the parameter "new" to true
when a new source is created, have fixed it.

igmp_get_source_by_addr api is currently setting the parameter
"new" to false always. This is not right. The caller apis are using
this field to decide and based on that take actions to create timers, etc.

Its need to be set to true when a new source is created.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-21 05:54:40 -07:00
Donald Sharp
dc7be57dfc
Merge pull request #10853 from plsaranya/pim_assert_fixes
pimd: assert fixes
2022-04-20 07:57:40 -04:00
Donald Sharp
831a15d3e3
Merge pull request #11023 from AbhishekNR/igmp_flag
pimd: Changing PIM_OIF_FLAG_PROTO_IGMP to PIM_OIF_FLAG_PROTO_GM
2022-04-20 07:43:09 -04:00
Donald Sharp
f526739897 *: Fix spelling of accomodate
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:29:58 -04:00
Donald Sharp
2ef62909a9 *: Fix spelling of atleast
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:25:03 -04:00
Donald Sharp
3819e4ced7 *: Fix spelling of inteface
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:21:31 -04:00
Donald Sharp
b97047ed11 *: Fix spelling of non-existant
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:16:45 -04:00
Mobashshera Rasool
3d4c335568 pim6d: Correct the spelling of Rendezvous
Rendevous --> Rendezvous
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-18 23:17:43 -07:00
Mobashshera Rasool
a6324d6a30 pimd: Correct the spelling of Rendezvous
Rendevous --> Rendezvous
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-18 23:17:43 -07:00
mobash-rasool
4e3ccd396c
Merge pull request #10931 from g-balaji1/pimv6-ssm-cmds
pim6d: Addition of ipv6 ssmpingd config commands
2022-04-13 15:50:31 +05:30
Abhishek N R
80a82b567f pimd: Changing PIM_OIF_FLAG_PROTO_IGMP to PIM_OIF_FLAG_PROTO_GM
Modified marco name so that it can be reused in mld.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-13 01:19:03 -07:00
mobash-rasool
8e53f35b5f
Merge pull request #10989 from opensourcerouting/pim-options-remove
pimd: remove pim_interface->options
2022-04-12 21:10:44 +05:30
Balaji Gurudoss
a8caf78d61 pim6d: Addition of ipv6 ssmpingd config commands
Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
2022-04-12 18:07:24 +05:30
Mobashshera Rasool
e1f87dce0f pimd: correct the show ip igmp sources output
frr(config-if)# ip igmp join 232.1.1.1 10.10.10.10
frr(config-if)# do sh ip igmp sources
Interface        Address         Group           Source          Timer Fwd Uptime
ens192           232.1.1.1       10.10.10.10     04:10   N 00:00:10
frr(config-if)#

The above output is misaligned and is having Address field which is not
required here.

Fixing it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-11 00:17:11 -07:00
David Lamparter
4f977c8e77 pimd: remove pim_interface->options
I should've removed this in #10960.  It's a hazard in terms of
forgetting to adjust PRs/other changes that might accidentally still
reference the field.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-08 10:30:24 +02:00
David Lamparter
95793341ab pimd: use SSM check helper
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-07 14:00:40 +02:00
David Lamparter
eeec411244 lib, pimd: add a bunch of address helpers
Just simple helpers to get a scope value, never-forward, and is-SSM for
a given address.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-07 14:00:36 +02:00
sarita patra
eed4433df4 pim6d: Handle mrib_nexthop_addr zclient_lookup_nexthop
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:56:31 -07:00
sarita patra
265dec6ab8 pim6d: Adjust IPV6 zclient_lookup_read_pipe
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:51:20 -07:00
sarita patra
ebbecd2106 pim6d: Adjust IPV6 zclient_lookup_nexthop_once
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:49:58 -07:00
sarita patra
eed74896d4 pim6d: Adjust IPV6 zclient_read_nexthop
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:48:13 -07:00
sarita patra
dac86a0a2d pim6d: Handle mrib_nexthop_addr & pim_zlookup_nexthop in pim_nht
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:37:58 -07:00
sarita patra
cbe1dbba30 pim6d: modify nexthop_addr to pim_addr in pim_zlookup_nexthop
Currently pim_zlookup_nexthop is of type struct prefix, but it's always
a /32 host prefix. So changing it to pim_addr in order to support both
IPV4 and IPV6.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:37:58 -07:00
sarita patra
641ac7c7d3 pim6d: Display mrib_nexthop_addr with %pPA
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:37:58 -07:00
sarita patra
d8a2f46667 pim6d: Handle mrib_nexthop_addr in pim_upstream
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:37:58 -07:00
sarita patra
7b94245256 pim6d: Adjust mrib_nexthop_addr igmp_mtrace code
In this PR, we are handling the igmp_mtrace code
after mrib_nexthop_addr modified from prefix
to pim_addr.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:37:12 -07:00
sarita patra
0332b088d3 pim6d: Adjust mrib_nexthop_addr msdp code
In this PR, we are handling the msdp code
after mrib_nexthop_addr modified from prefix
to pim_addr.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:36:42 -07:00
sarita patra
34a466b78c pim6d: Adjust mrib_nexthop_addr rpf code
In this PR, we are handling the pim_rpf code
after mrib_nexthop_addr modified from prefix
to pim_addr.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:35:12 -07:00
sarita patra
a1bc5746a9 pim6d: modify mrib_nexthop_addr from prefix to pim_addr
Currently mrib_nexthop_addr is of type struct prefix, but it's always
a /32 host prefix. So changing it to pim_addr in order to support both
IPV4 and IPV6.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-06 22:34:38 -07:00
Mobashshera Rasool
969e751921 pimd: Remove pim_channel_oil_change_iif from header file
pim_channel_oil_change_iif is sitting idly in .h file with no
definition.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-05 21:54:01 -07:00
mobash-rasool
25ddb686ca
Merge pull request #10965 from opensourcerouting/fix/pim_igmp_group_delete
pimd: Replace ALL_LIST_ELEMENTS_RO to ALL_LIST_ELEMENTS group_list it…
2022-04-06 04:07:30 +05:30
David Lamparter
8996a815b5
Merge pull request #10365 from SaiGomathiN/ipv6-config-cmd 2022-04-05 21:07:15 +02:00
Donald Sharp
0e3aad23de
Merge pull request #10940 from opensourcerouting/pim-5549-clarify
pimd: clarify RFC5549 nexthop handling (& fix for pim6d)
2022-04-05 09:43:39 -04:00
Donald Sharp
95e6a352d8
Merge pull request #10959 from patrasar/pim_coverity
pimd: Fixing pim coverity issues
2022-04-05 09:38:42 -04:00
mobash-rasool
37cfc612fc
Merge pull request #10960 from opensourcerouting/pim-unmacro-1
pimd: remove useless PIM_IF_* macros
2022-04-05 15:17:25 +05:30
Donatas Abraitis
5c13cb9dc5 pimd: Replace ALL_LIST_ELEMENTS_RO to ALL_LIST_ELEMENTS group_list iteration
To reproduce:
```
ip pim ssm prefix-list pim-ssm-group
ip prefix-list pim-ssm-group seq 10 permit 238.4.0.0/16 ge 32 le 32
```

Assert:
```
pimd[645545]: pimd/pim_igmp.c:148: igmp_source_forward_reevaluate_all(): assertion ((srcnode)->data != NULL) failed
PIM[645545]: Received signal 6 at 1649140750 (si_addr 0x6e0009d9a9, PC 0x7fe5e3f95ce1); aborting...
PIM[645545]: /usr/local/lib/libfrr.so.0(zlog_backtrace_sigsafe+0x5e) [0x7fe5e41f2d7e]
PIM[645545]: /usr/local/lib/libfrr.so.0(zlog_signal+0xe6) [0x7fe5e41f2f56]
PIM[645545]: /usr/local/lib/libfrr.so.0(+0xc9412) [0x7fe5e421d412]
PIM[645545]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x14140) [0x7fe5e4133140]
PIM[645545]: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141) [0x7fe5e3f95ce1]
PIM[645545]: /lib/x86_64-linux-gnu/libc.so.6(abort+0x123) [0x7fe5e3f7f537]
PIM[645545]: /usr/local/lib/libfrr.so.0(_zlog_assert_failed+0xd7) [0x7fe5e4246c37]
PIM[645545]: /usr/lib/frr/pimd(igmp_source_forward_reevaluate_all+0x230) [0x5638c65e3d90]
PIM[645545]: /usr/lib/frr/pimd(pim_prefix_list_update+0x53) [0x5638c65cbbf3]
PIM[645545]: /usr/local/lib/libfrr.so.0(prefix_list_entry_update_start+0x82) [0x7fe5e420a0a2]
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-05 10:48:56 +03:00
Sai Gomathi N
1881b5c0ca pim6d: Adding ipv6 mld watermark-warn CLI
Adding the config mode command

ipv6 mld watermark-warn <1-65535>
This command can be use to warn the user
when more than the desired limit of groups gets configured.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-05 00:00:10 -07:00
Sai Gomathi N
25e1db4246 pimd: Moving the common function from pim_cmd.h file
Moving the PIM_DECLVAR_CONTEXT function to the
common file pim_cmd_common.h file

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-05 00:00:10 -07:00
Sai Gomathi N
e7ec758dff pim6d: Adding "ipv6 mld last-member-query-interval" CLI
Adding the Interface level config command

ipv6 mld last-member-query-interval (1-65535)
This command can be use to tune the response time for group specific queries.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-05 00:00:10 -07:00
Sai Gomathi N
c889adcb26 pim6d: Adding ipv6 mld last-member-query-count CLI
Adding the Interface level config command

ipv6 mld last-member-query-count (1-255)
This command can be use to tune the number of Multicast-Address- Specific Queries
sent before the router assumes there are no remaining listeners for an address on a link.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-05 00:00:10 -07:00
Sai Gomathi N
c8b3d45de2 pim6d: Adding "ipv6 mld query-max-response-time" CLI
Adding the Interface level config command

ipv6 mld query-max-response-time <1-65535>
This command can be use to tune the max response time for general queries.
The number of seconds represented by the [Query Response Interval] must be less than the [Query Interval]

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-05 00:00:01 -07:00
Jafar Al-Gharaibeh
eeeed628a3
Merge pull request #10946 from donaldsharp/pim_fhr_lhr_same_pimreg
pimd: Send immediate join( with possible SG RPT prune bit set
2022-04-04 14:00:49 -05:00
David Lamparter
f11bc92554 pim6d: fix mis-printed nexthop
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-04 14:48:54 +02:00
David Lamparter
c13a82352b pimd, pim6d: clarify RFC5549 MRIB nexthop handling
The entire `case NEXTHOP_TYPE_IPV6_IFINDEX:` block here was a bit of a
tripwire to stumble over, since there was no indication at all that this
concerns RFC5549 nexthop handling.  So it got mis-adapted for PIM IPv6
support.

Clarify this a whole bunch that this is for v4-over-v6 nexthop mangling,
and nothing else.

This should really also use neighbor's secondary address lists for the
lookup, but that is probably going to break compatibility with other
boxes that don't include v6 addrs in v4 hellos and needs further
machinery to do properly, so for now just leave a breadcrumb.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-04 14:48:54 +02:00
sarita patra
75a5ac751a pimd: fix pim_instance NULL deference in zclient_lookup_read_pipe
Fixing the below coverity issue.
>>>     CID 1515546:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "pim" when calling "zclient_lookup_nexthop_once".
391             zclient_lookup_nexthop_once(pim, nexthop_tab, 10, l);

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-04 05:27:59 -07:00
sarita patra
e2067d591b pimd: fix pim_instance NULL deference in pim_zebra_if_address_add
Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-04 05:27:59 -07:00
sarita patra
e2116917e5 pimd: fix pim_instance NULL deference in pim_vxlan_mlag_update
Fixing the below coverity issue.
>>>     CID 1515545:    (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "pim" when calling "pim_vxlan_set_peerlink_rif".
902                     pim_vxlan_set_peerlink_rif(pim, NULL);

Signed-off-by: sarita patra <saritap@vmware.com>
2022-04-04 05:27:57 -07:00
David Lamparter
b6fcc0b7a6 pimd: remove useless PIM_IF_* macros
The only function these macros have is to make the code confusing.
"PIM_IF_DO_PIM" sounds like it triggers some action, but it doesn't.

Replace with "bool" fields in struct pim_interface.

(Note: PIM_IF_*_IGMP_LISTEN_ALLROUTERS was always set, without any way
to unset it.  It is completely removed now and always enabled.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-04 14:11:29 +02:00
Sai Gomathi N
9d6d027011 pim6d: Adding show ipv6 pim nexthop and nexthop-lookup commands
Adding new show commands to display pim nexthops and
pim nexthop lookups received from zebra.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:03 -07:00
Sai Gomathi N
1295dbebe8 pim6d: Adding "show ipv6 [vrf|vrf ALL] pim neighbor" command
Adding new show CLI to display regarding pim neighbors.
Changing DEFUN to DEFPY for "show ip pim neighbor" command.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:03 -07:00
Sai Gomathi N
de11054ed0 pim6d: Adding "show ipv6 pim local-membership"
Adding the new cli to display pim local membership information.
Changing DEFUN to DEPFY for "show ip pim local-membership"

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:03 -07:00
Sai Gomathi N
be2232396a pim6d: Adding "show ipv6 pim jp-agg" command
Adding new show CLI to display pim join prune aggregate information.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:03 -07:00
Sai Gomathi N
24de75a254 pim6d: Adding "show ipv6 pim [vrf|vrf all] join" command
Adding show ipv6 pim join and show ipv6 pim vrf all join
CLIs to display pim join related information and
formatted the json output for "show ip pim join" and
"show ip pim vrf all join" commands.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:02 -07:00
Sai Gomathi N
44f99d2232 pim6d: Adding "show ipv6 pim [vrf|vrf all] interface" command
Adding show ipv6 pim interface and show ipv6 pim vrf all interface
CLIs to display pim enabled interface informations and
formatted the json output for "show ip pim interface" and
"show ip pim vrf all interface" commands.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:02 -07:00
Sai Gomathi N
bf083b3a66 pim6d: Adding "show ipv6 pim channel" command
Adding new CLI to display pim channel informations.
Changing DEFUN to DEPFY for ""show ip pim channel"

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:02 -07:00
Sai Gomathi N
e2b601e8e1 pimd: Moving the common functions from pim_cmd.c file
Moving the functions that are used by both IPV4 and IPV6 to a
common file pim_cmd_common.c file

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-04-04 00:52:02 -07:00
Donald Sharp
07b12758be pimd, zebra: Fix spelling of fowarding
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02 07:46:19 -04:00
Donald Sharp
33ec4015b6 pimd: Send immediate join( with possible SG RPT prune bit set
When pimd has this setup:

src ----- rtr ------ receiver
           |
          rp

And the receiver sends a *,G join to rtr.  When the
src starts sending a S,G, rtr can wait up to one join/prune
interval before sending a S,G rpt prune.  This interval
causes the pimreg device to be in the S,G OIL as that the
RP does not know to prune this leg off.

before:

Timestamp: Thu Mar 31 10:15:18 2022 288767 usec
[MROUTE](10.103.0.5,239.0.0.4)           Iif: rtr-lan_src Oifs: rtr-lan  State: resolved Table: default
Timestamp: Thu Mar 31 10:15:18 2022 288777 usec
[MROUTE](10.103.0.5,239.0.0.4)           Iif: rtr-lan_src Oifs: rtr-lan rtr-lan-1  State: resolved Table: default
Timestamp: Thu Mar 31 10:15:18 2022 288789 usec
[MROUTE](10.103.0.5,239.0.0.4)           Iif: rtr-lan_src Oifs: pimreg rtr-lan rtr-lan-1  State: resolved Table: default
Timestamp: Thu Mar 31 10:15:49 2022 324995 usec
[MROUTE](10.103.0.5,239.0.0.4)           Iif: rtr-lan_src Oifs: rtr-lan rtr-lan-1  State: resolved Table: default
<31 seconds>

After:

Timestamp: Thu Mar 31 12:56:15 2022 501921 usec
(10.103.0.5,239.0.0.27)          Iif: rtr-lan_src Oifs: pimreg rtr-lan  State: resolved Table: default
Timestamp: Thu Mar 31 12:56:15 2022 501930 usec
(10.103.0.5,239.0.0.27)          Iif: rtr-lan_src Oifs: pimreg rtr-lan rtr-lan-1  State: resolved Table: default
Timestamp: Thu Mar 31 12:56:15 2022 502181 usec
(10.103.0.5,239.0.0.27)          Iif: rtr-lan_src Oifs: rtr-lan rtr-lan-1  State: resolved Table: default
<sub second>

What is actually happening:

rtr receives a *,G igmp join, sends a *,G join towards the rp
rtr receives a S,G packet <WRVIFWHOLE>
creates the S,G upstream, sends the register packet to the rp
the rp sees that it still has downstream interest so it forwards the packet on
After (up to 60 seconds ) the rtr, sends the normally scheduled join for
the G and sends the S,GRPT prune as part of it.

What is being done to fix it:

In wrvifwhole handling, when pimd detects that this is the FHR
and is not the RP *and* the incoming interface for the *,G
is different than the incomding interface for the S,G immediately
send a single join packet for the G( which will have the S,G RPT
prune in it ).  Only do this on the first time receiving the
WRVIFWHOLE.

Ticket: #2755650
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 09:01:38 -04:00
David Lamparter
c0d6ed6bc4
Merge pull request #10676 from AbhishekNR/pim_showcli_com 2022-03-30 17:15:54 +02:00
Donald Sharp
1bb4a33d05
Merge pull request #10912 from mobash-rasool/fixes2
pimd: Do not create PIM state when an invalid IGMPv3 join is received
2022-03-30 10:34:56 -04:00
mobash-rasool
f06b9fee95
Merge pull request #10882 from opensourcerouting/pim6-txrx
pim6d: send IPv6 PIM packets
2022-03-29 18:30:10 +05:30
plsaranya
2145e986b4 pimd: RPF change after winner election
Problem:
   Once Assert election is over and winner is elected, the downstream router has to prune from the upstream LOSER if it has joined already and have to join with upstream elected WINNER

pim_rpf_update function takes care of changing the rpf_ch if the
existing one is PIM_IFASSERT_I_AM_LOSER

Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-03-29 13:57:14 +05:30
Abhishek N R
2d85c67144 pim6d: Implementing "show ipv6 pim state" CLI
Adding new show CLI to display pim internal state related to groups.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
b1a419baef pim6d: Implementing "show ipv6 pim upstream-rpf" CLI.
Adding new show CLI to display pim RPF for upstreams.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
e577f6e7d5 pim6d: Implementing "show ipv6 pim upstream-join-desired" CLI
Adding new show CLI to display group join desired status.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
95023bd72a pim6d: Implementing "show ipv6 pim upstream" CLI
Adding new show CLI to display pim upstream information.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
4f58b6aaa4 pim6d: Implementing "show ipv6 pim statistics" CLI
Adding new show CLI to display pim statistics.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
626dab7f3f pim6d: Implementing "show ipv6 pim secondary" CLI
Adding new show CLI to display pim secondary addresses.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
1aa8de4687 pim6d: Implementing "show ipv6 pim rpf" CLI
Adding new show CLI to display pim RPF information.

Also corrected ipv4 json object.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
45e26aa0b2 pimd: Moving the common functions from pim_cmd.c
Moving the functions that are used by both IPV4 and IPV6 to a
common file pim_cmd_common.c file

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:24 -07:00
Abhishek N R
0095f482ca pim6d: Implementing "show ipv6 pim rp-info" CLI
Adding new show CLI to display pim RP information.

Also corrected ipv4 json object.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-28 23:53:15 -07:00
Mobashshera Rasool
261b019f78 pimd: update the pim state when there is a group change
Re-evaluate the creation/deletion of groups when there is
a change in group type.

Issue: #10128
Co-authored-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-28 22:45:33 -07:00
Mobashshera Rasool
037a2c2e37 pimd: Do not create PIM state for invalid (S,G)
Currently FRR creates an (S,G) PIM state when an IGMPv3
(S,G) join with INCLUDE mode is received for the ASM group.

Since it is an ASM group, we should not create (S,G) PIM state
and should not be sending PIM (S,G) joins towards the source.

This is a misconfiguration. So keep this group in IGMP table
and do not create PIM state.

Issue: #10128
Co-authored-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-28 22:45:28 -07:00
David Lamparter
e7485deb0a pim6d: box out IPv4 fragmentation code
... this shouldn't run for IPv6.  (We'll switch to not using
IPV6_HDRINCL later, so the kernel will handle it, but for the time being
let's just stop trying to use the IPv4 code for IPv6.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 17:59:16 +02:00
Donald Sharp
80e39114b5
Merge pull request #10897 from opensourcerouting/safi-nht
zebra,staticd,*: SAFI_MULTICAST NHT groundwork
2022-03-28 08:23:36 -04:00
David Lamparter
721c7be3b2 pim6d: include IPv6 pseudoheader in RX checksums
A lot simpler than the TX code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
David Lamparter
145e4c38b9 pim6d: include IPv6 pseudoheader in TX checksums
Lots of passing src/dst around, but it is what it is.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
David Lamparter
b6d9ad298d pim6d: reenable socket functions
pim_sock_*() functions are adapted for IPv6 now, reenable calling them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
David Lamparter
cc362d24aa pim6d: send PIM packets
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:22 +02:00
David Lamparter
7993f685c1
Merge pull request #10661 from plsaranya/pim6_msg 2022-03-28 14:04:44 +02:00
David Lamparter
da4d4d7b39
Merge pull request #10366 from AbhishekNR/mld_cli 2022-03-28 09:18:36 +02:00
David Lamparter
12a0d83c8c pim6d: fix string constant size
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 16:18:59 +02:00
David Lamparter
eb3c9d9774 *: add SAFI argument to zclient_send_rnh
Just pushing that SAFI_UNICAST up 1 level to the caller.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:22 +02:00
Donald Sharp
5bc17d7bd0
Merge pull request #10677 from mobash-rasool/pimv6-receive-pkt
pim6d: Handling of receiving of PIMv6 packets
2022-03-25 14:09:20 -04:00
plsaranya
db89f2a3eb pimd: Assert fixes
Problem:
PIM assert is not triggered even after receiving WRONGVIF notification because of Could_assert flag not set.
CouldAssert(S,G,I) =
        SPTbit(S,G)==TRUE
        AND (RPF_interface(S) != I)
        AND (I in ( ( joins(*,G) (-) prunes(S,G,rpt) )
                    (+) ( pim_include(*,G) (-) pim_exclude(S,G) )
                    (-) lost_assert(*,G)
                    (+) joins(S,G) (+) pim_include(S,G) ) )
Once SPTbit is set, Could_assert has to be reevaluated

Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-03-25 19:48:54 +05:30
David Lamparter
5e6e8a3959 pim6d: IPv6 headers are always stripped on receive
IPV6_HDRINCL is a TX-only option (unlike IP_HDRINCL), so on RX there
never are IPv6 headers to be looked at / skipped over.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-25 04:24:15 -07:00
Mobashshera Rasool
f20d0d7cf2 pim6d: Adjust pim_pkt_dst_addr_ok for PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25 04:24:15 -07:00
Mobashshera Rasool
5e2b203384 pimd: Modify pim_pim_packet api for receiving v6 packets
Modified the pim_pim_packet api for pimv4/v6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25 04:24:09 -07:00
Mobashshera Rasool
76bfa0302c pim6d: Parse BSM packet for PIMv6
Modify pim_bsm_process to accomodate v4 and v6 address
for parsing the received packet.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25 03:57:19 -07:00
David Lamparter
34389f8886 pim6d: fix format string mistakes in ssmpingd
PR #10653 forgot to update a bunch of format specifiers.  Fix.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-25 11:36:21 +01:00
David Lamparter
c8d30f4f9e pim6d: fix remaining IPv6 mroute nits
- im6_src/dst are in6_addr, not pim_addr, so `%pI6` should be used
- the sockopt is IPV6_RECVPKTINFO not IPV6_PKTINFO

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-24 12:32:30 +01:00
plsaranya
a5fa982256 pim6d: Mroute changes
Mroute and supporting changes

Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-03-23 19:34:28 +05:30
Mobashshera Rasool
6d0a6ede82 pimd: correct prefix-list ssm range update for exclude mode
Modifying the code as per RFC 4604 section 2.2.1
EXCLUDE mode does not apply to SSM addresses, and an SSM-aware router
will ignore MODE_IS_EXCLUDE and CHANGE_TO_EXCLUDE_MODE requests in
the SSM range.

Issue is observed when a group in exclude mode was in ASM range
as per the prefix-list and then prefix-list is modified to make
it fall under SSM range. The (*,G) entry remains there.

So when the group moves to ssm range and it is exclude mode,
delete the group from the IGMP table.

Co-authored-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-22 11:05:54 -07:00
Jafar Al-Gharaibeh
f577fdc4e8
Merge pull request #10809 from donaldsharp/pim_igmp_query
Pim igmp query
2022-03-21 22:37:26 -05:00
Donatas Abraitis
13cd4ff4e1
Merge pull request #10815 from pguibert6WIND/pim_debug_vxlan
pimd: add 'debug pim vxlan' when 'debug pim' is used
2022-03-21 15:47:49 +02:00
Donatas Abraitis
374eefb18b
Merge pull request #10832 from patrasar/2520720
pimd: add source and group information in mroute json
2022-03-21 13:38:14 +02:00
sarita patra
f37cbaea86 pimd: source/group information now added for pruned entry
show ip mroute json command displays the source, group info
per oil, so for pruned group since the OIL is empty, it is not
showing.

Fix: Added the above information per source.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-20 23:43:55 -07:00
Donatas Abraitis
2efc3acd9e
Merge pull request #9476 from SaiGomathiN/pim-nht
pimd: Added new option "detail" in the "debug pim nht" CLI
2022-03-20 23:14:08 +02:00
mobash-rasool
0cd8bce123
Merge pull request #10813 from opensourcerouting/fix/include_prune_stats_for_pim_traffic_interface
pimd: Include pruneTx/pruneRx for `show ip pim interface traffic WORD…
2022-03-17 23:36:30 +05:30
Philippe Guibert
dedcdb892b pimd: add 'debug pim vxlan' when 'debug pim' is used
Reversely, negating 'debug pim' will disable vxlan debugging.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-03-17 14:36:41 +01:00
Donatas Abraitis
7d0bc72987 pimd: Include pruneTx/pruneRx for show ip pim interface traffic WORD json
```
exit1-debian-11# sh ip pim interface traffic eth2 json
{
  "eth2":{
    "name":"eth2",
    "state":"up",
    "address":"192.168.10.123",
    "index":4,
    "flagMulticast":true,
    "flagBroadcast":true,
    "lanDelayEnabled":true,
    "helloRx":2,
    "helloTx":2,
    "joinRx":0,
    "joinTx":1,
    "pruneRx":0,
    "pruneTx":0,
    "registerRx":0,
    "registerTx":0,
    "registerStopRx":0,
    "registerStopTx":0,
    "assertRx":0,
    "assertTx":0,
    "bsmRx":0,
    "bsmTx":0
  }
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-17 10:00:02 +02:00
Donatas Abraitis
c07ddc3656 pimd: Show all groups matched by an arbitrary prefix for pim rp-info
```
r1# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source   Group-Type
192.168.10.123   225.0.0.0/24        eth2              yes        Static   ASM
192.168.10.123   239.0.0.0/8         eth2              yes        Static   ASM
192.168.10.123   239.4.0.0/24        eth2              yes        Static   SSM

r1# show ip pim rp-info 239.4.0.0/25
RP address       group/prefix-list   OIF               I am RP    Source   Group-Type
192.168.10.123   239.0.0.0/8         eth2              yes        Static   ASM
192.168.10.123   239.4.0.0/24        eth2              yes        Static   SSM
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-17 09:38:22 +02:00
ron
2674ba0ab0 pimd: fix igmp packet check
ip source 0.0.0.0 is OK (RFC 3376: 4.2.13.).

Signed-off-by: ron <lyq140hf2006@163.com>
2022-03-16 15:48:51 -04:00
ron
1c475815a8 pimd: fix igmp query packet
'Max Resp Time' in v2 query needs no encode (RFC 2236: 2.2.).

Signed-off-by: ron <lyq140hf2006@163.com>
2022-03-16 15:43:27 -04:00
Donald Sharp
bf1bf09616
Merge pull request #10653 from g-balaji1/pimv6-ssm
pim6d: pim_ssmpingd changes to support PIMv6
2022-03-16 08:40:29 -04:00
Balaji Gurudoss
1c56018f66 pim6d: Changes done in pim_ssmpingd to support v6
Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
2022-03-16 13:54:24 +05:30
Donald Sharp
ed03d4d03b
Merge pull request #10791 from opensourcerouting/feature/igmp_stats_total_received_message
pimd: Add additional IGMP stats (peak number of groups)
2022-03-15 15:14:37 -04:00
Donatas Abraitis
42982834d4 pimd: Return empty JSON if we query non existing interface for IGMP stats
Now we return all zeroed stats, which seems wrong. Handle the same way, as
with PIM interfaces. Return empty JSON and a warning for VTYSH.

```
exit1-debian-11# sh ip igmp statistics interface belekas
% No such interface
exit1-debian-11# sh ip igmp statistics interface belekas json
{
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-15 17:08:35 +02:00
Donatas Abraitis
a191345424
Merge pull request #10792 from donaldsharp/pim_blargle
Fix up #6058
2022-03-15 16:22:37 +02:00
Donatas Abraitis
baa57b7282
Merge pull request #10583 from donaldsharp/pim_upstream_timers
pimd: Ensure timers are stopped on instance shutdown
2022-03-15 14:35:30 +02:00
Donatas Abraitis
3e5d8665f6 pimd: Add additional IGMP stats (peak number of groups)
```
exit1-debian-11# sh ip igmp statistics interface eth2
IGMP statistics
Interface            : eth2
V1 query             : 0
V2 query             : 0
V3 query             : 25
V2 leave             : 0
V1 report            : 0
V2 report            : 0
V3 report            : 34
mtrace response      : 0
mtrace request       : 0
unsupported          : 0
joins failed         : 0
joins sent           : 13
general queries sent : 2
group queries sent   : 24
peak groups          : 9
total groups         : 4
total source groups  : 1
exit1-debian-11# sh ip igmp statistics interface eth2 json
{
  "eth2":{
    "name":"eth2",
    "queryV1":0,
    "queryV2":0,
    "queryV3":25,
    "leaveV2":0,
    "reportV1":0,
    "reportV2":0,
    "reportV3":34,
    "mtraceResponse":0,
    "mtraceRequest":0,
    "unsupported":0,
    "peakGroups":9,
    "totalGroups":4,
    "totalSourceGroups":1,
    "joinsFailed":0,
    "joinsSent":13,
    "generalQueriesSent":2,
    "groupQueriesSent":24
  }
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-15 14:08:35 +02:00
Donald Sharp
cde5655bf4
Merge pull request #10793 from opensourcerouting/feature/igmp_stats_total_received_messages
pimd: Show total received messages IGMP stats
2022-03-15 07:56:00 -04:00
Donald Sharp
6ec6186af9
Merge pull request #10012 from AbhishekNR/upstream
pimd : Handling of Exclude mode IGMPv3 report messages for SSM aware group.
2022-03-15 07:54:04 -04:00
Abhishek N R
5795b17cc3 pim6d: Adding "ipv6 mld query-interval" CLI
Adding the Interface level config command

ipv6 mld query-interval <1-65535>
This command can be use to tune the timing for the general queries sent by the querier.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-14 23:11:21 -07:00
Abhishek N R
47d4af36d8 pim6d: Adding "ipv6 mld version" CLI
Adding the Interface level config command

ipv6 mld version <1-2>
This command can be use to configure MLD version on the interface.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-14 23:11:14 -07:00
Abhishek N R
eaa7d656bb pim6d: Adding "ipv6 mld" CLI
Adding the Interface level config command

ipv6 mld
To enable MLD on the interface.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-14 23:10:41 -07:00
Abhishek N R
fe2df4f7ba pim6d: Adding "ipv6 mld join" CLI
Adding the Interface level config command

ipv6 mld join
This command can be used to configure the static MLD join
for IPv6 group addresses on the interfaces.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-14 23:00:38 -07:00
Donatas Abraitis
ca3e7807f6 pimd: Show total received messages IGMP stats
```
exit1-debian-11# do sh ip igmp statistics
IGMP statistics
Interface               : global
V1 query                : 0
V2 query                : 0
V3 query                : 3
V2 leave                : 0
V1 report               : 0
V2 report               : 0
V3 report               : 18
mtrace response         : 0
mtrace request          : 0
unsupported             : 0
total received messages : 21
joins failed            : 0
joins sent              : 16
general queries sent    : 6
group queries sent      : 3
total groups            : 4
total source groups     : 1
exit1-debian-11# do sh ip igmp statistics json
{
  "global":{
    "name":"global",
    "queryV1":0,
    "queryV2":0,
    "queryV3":4,
    "leaveV2":0,
    "reportV1":0,
    "reportV2":0,
    "reportV3":18,
    "mtraceResponse":0,
    "mtraceRequest":0,
    "unsupported":0,
    "totalReceivedMessage":22,
    "totalGroups":3,
    "totalSourceGroups":1,
    "joinsFailed":0,
    "joinsSent":16,
    "generalQueriesSent":6,
    "groupQueriesSent":4
  }
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-14 22:49:23 +02:00
Donald Sharp
1aa3f6b199 pimd: A wrong address family means the register-stop receive fails
The current code in pim_register_stop_recv would never fail as
that the code was always returning 0 in all cases, but
if the code parses an incorrect afi then it has failed and
should return as much

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-14 15:52:37 -04:00
saravanank
03f9d812f9 pimd: FRR-PIM sending register packet even after receiving (*,G) register stop
RCA: (*,G) register stop was not handled

Fix: Loop through all (S,G) under the (*,G) and apply reg stop

Authored-by- Saravanan K <saravanank@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-14 15:48:07 -04:00
Donald Sharp
7a382e16e6
Merge pull request #10786 from opensourcerouting/pim6-pim-prep
pim6d: prepare for sending & receiving actual PIM packets
2022-03-14 09:35:37 -04:00
Donatas Abraitis
278912eabf pimd: Add additional IGMP stats (generic/group specific queries sent)
```
exit1-debian-11# sh ip igmp statistics
IGMP statistics
Interface            : global
V1 query             : 0
V2 query             : 0
V3 query             : 6
V2 leave             : 0
V1 report            : 0
V2 report            : 0
V3 report            : 14
mtrace response      : 0
mtrace request       : 0
unsupported          : 0
joins failed         : 0
joins sent           : 16
general queries sent : 6
group queries sent   : 4
total groups         : 5
total source groups  : 1
exit1-debian-11# sh ip igmp statistics json
{
  "global":{
    "name":"global",
    "queryV1":0,
    "queryV2":0,
    "queryV3":6,
    "leaveV2":0,
    "reportV1":0,
    "reportV2":0,
    "reportV3":18,
    "mtraceResponse":0,
    "mtraceRequest":0,
    "unsupported":0,
    "totalGroups":5,
    "totalSourceGroups":1,
    "joinsFailed":0,
    "joinsSent":16,
    "generalQueriesSent":6,
    "groupQueriesSent":4
  }
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-14 10:50:28 +02:00
Donatas Abraitis
7665a2e1cd pimd: Fix indentation for struct igmp_stats
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-14 09:24:49 +02:00
Donald Sharp
7baebfb715
Merge pull request #10447 from ton31337/fix/json_with_whitespaces
*: Fix JSON keys with whitespaces and PascalCase
2022-03-13 18:19:33 -04:00
Donatas Abraitis
f2058cb425 pimd: Add IGMP join sent/failed statistics
```
exit1-debian-11# sh ip igmp statistics
IGMP statistics
Interface           : global
V1 query            : 0
V2 query            : 0
V3 query            : 0
V2 leave            : 0
V1 report           : 0
V2 report           : 0
V3 report           : 16
mtrace response     : 0
mtrace request      : 0
unsupported         : 0
joins failed        : 0
joins sent          : 11
total groups        : 4
total source groups : 0
exit1-debian-11# sh ip igmp statistics json
{
  "global":{
    "name":"global",
    "queryV1":0,
    "queryV2":0,
    "queryV3":0,
    "leaveV3":0,
    "reportV1":0,
    "reportV2":0,
    "reportV3":16,
    "mtraceResponse":0,
    "mtraceRequest":0,
    "unsupported":0,
    "totalGroups":4,
    "totalSourceGroups":0,
    "joinsFailed":0,
    "joinsSent":11
  }
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-13 19:31:34 +02:00
Donald Sharp
6ea4244514
Merge pull request #10399 from g-balaji1/pimv6-sock
pim6d: PIMv6 socket related changes
2022-03-13 10:03:45 -04:00
David Lamparter
ccc3ccd38c pim6d: decode IPv6 source addresses
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:34 +01:00
David Lamparter
042a754146 pim6d: encode PIM joins correctly
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:34 +01:00
David Lamparter
334326ed39 pim6d: reenable pim_init()
... so we have `qpim_all_pim_routers_addr` initialized.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:34 +01:00
David Lamparter
185754fe7c pimd: be more informative about missing neighbors
Much more useful to know what we were trying to find a neighbor for.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:28 +01:00
David Lamparter
516b97fe4d pimd: log interface name for send errors
Not very helpful to be told only the fd number.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:17 +01:00
David Lamparter
97feb13f0f pim6d: reenable address management code
A few more pieces that should now work reasonably well for IPv6.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:13 +01:00
David Lamparter
cfef61553f pim6d: rework interface address tracking/selection
We only care about link-local addresses for IPv6 operation.  Also, MLD
needs the lowest while PIM needs the highest...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:13 +01:00
David Lamparter
cd6d285855 pimd: refactor/split IGMP integration
Try to untangle some spaghetti...

This is an 1:1 change that should not result in any functional
difference.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:08 +01:00
David Lamparter
d6890c49b2 pimd: add safety check to OIL add/del
These will corrupt memory if mroute_vif_index is -1 (e.g. interface not
operating.)  That shouldn't happen, but it does while doing development
work, so trip an assert rather than corrupting memory.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:08 +01:00
Donald Sharp
e576475723
Merge pull request #10744 from opensourcerouting/igmp-json-leave-typo
pimd: fix typo in IGMP interface statistics JSON output.
2022-03-12 16:09:58 -05:00
Donald Sharp
d7ffe67b0c
Merge pull request #10746 from ton31337/feature/show_group_type_under_rp_info_cli
pimd: Show group-type under `show ip pim rp-info`
2022-03-12 15:28:28 -05:00
Donatas Abraitis
3b3b5ab350
Merge pull request #10783 from donaldsharp/bgp_zebra_nht
Bgp zebra nht
2022-03-12 21:46:13 +02:00
Donald Sharp
06e4e90132 *: When matching against a nexthop send and process what it matched against
Currently the nexthop tracking code is only sending to the requestor
what it was requested to match against.  When the nexthop tracking
code was simplified to not need an import check and a nexthop check
in b8210849b8 for bgpd.  It was not
noticed that a longer prefix could match but it would be seen
as a match because FRR was not sending up both the resolved
route prefix and the route FRR was asked to match against.

This code change causes the nexthop tracking code to pass
back up the matched requested route (so that the calling
protocol can figure out which one it is being told about )
as well as the actual prefix that was matched to.

Fixes: #10766
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-12 11:18:45 -05:00
David Lamparter
30d408e6c7
Merge pull request #10781 from donaldsharp/remove_unused_function 2022-03-12 16:40:48 +01:00
Balaji Gurudoss
023d3e4af8 pim6d: pim6d socket changes
socket changes to support IPv6 PIM

Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
[DL: cleaned up & refactored a whole bunch more.]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 15:59:01 +01:00
Donald Sharp
58c05959d5 bgpd, lib, pimd: Remove sockopt_cork
sockopt_cork is a no-op function that was cleaned up
in 2017.  Since then it's still not being used.  At
this point in time there is little point in keeping a
dead function that will not be used because of vagaries
between platforms

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-12 08:21:16 -05:00
Donald Sharp
6aa54b144a
Merge pull request #10780 from mobash-rasool/fixes
pimd: Fix Null pointer dereference
2022-03-12 08:07:50 -05:00
David Lamparter
c532e50351 pimd: drop printing IP_MULTICAST_LOOP sockopt
This isn't a system or interface setting, it's a socket behavior.  It is
both irrelevant and confusing to the user since it doesn't affect any
system behavior (but it sounds like it does).  Whether it is enabled or
not is solely relevant to how the code is designed to work.

So, remove it from output.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 12:55:12 +01:00
Donatas Abraitis
8c0a76808a pimd: Show group-type under show ip pim rp-info
And filter by group for PIM.

```
exit1-debian-11# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source   Group-Type
192.168.10.17    238.0.0.0/24        eth2              no         Static   ASM
192.168.10.110   232.0.0.0/24        eth2              no         Static   SSM
exit1-debian-11# show ip pim rp-info 238.0.0.0/24
RP address       group/prefix-list   OIF               I am RP    Source   Group-Type
192.168.10.17    238.0.0.0/24        eth2              no         Static   ASM
exit1-debian-11# show ip pim rp-info 238.0.0.0/24 json
{
  "192.168.10.17":[
    {
      "rpAddress":"192.168.10.17",
      "outboundInterface":"eth2",
      "iAmRP":false,
      "group":"238.0.0.0/24",
      "source":"Static",
      "groupType":"ASM"
    }
  ]
}
exit1-debian-11#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-12 10:41:07 +02:00
Donald Sharp
44f1c44c2d
Merge pull request #10759 from opensourcerouting/feature/add_more_stats_for_igmp
pimd: Add IGMP total groups and total source groups to statistics
2022-03-11 14:32:05 -05:00
Mobashshera Rasool
ea5f4c4c57 pimd: Fix Null pointer dereferences
Fixing the below problem:
Dereferencing a pointer that might be "NULL" "group_dnode"
when calling "yang_is_last_list_dnode" in api pim_process_no_rp_cmd

Although there is no NULL pointer dereference since
yang_dnode_exists is called before using the dnode.
So removing the unnecessary yang_dnode_exists api call
and directly get the node and if node does not exists,
return.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-11 10:07:01 -08:00
David Lamparter
41490e0ede pim6d: fix some format strings for IPv6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
David Lamparter
5d1d18a10e pim6d: fix some IPv6 confusion in RP code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
David Lamparter
243e02abae pimd: RP code indentation adjustment
Need to fix some bits here and running into the "80-ch wall".

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
David Lamparter
f1bfeadcc1
Merge pull request #10707 from mobash-rasool/pimv6-register-recv 2022-03-10 19:00:45 +01:00
Mobashshera Rasool
e782863dfc pim6d: Replace pim_br_unknown with PIMADDR_ANY
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:52 -08:00
Mobashshera Rasool
a141ea61e7 pim6d: Handle B bit changes for IPv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:52 -08:00
Mobashshera Rasool
c7842d245e pim6d: Parsing pimv6 register msg
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:46 -08:00
Mobashshera Rasool
d1fd950aa0 pim6d: Abstract api to get src and dst from ip hdr
IPv4 uses "struct ip" and IPv6 uses "struct ip6_hdr" as
headers. Get the src and dst in pim_sgaddr.
Added api pim_sgaddr_from_iphdr to do so.

Signed-off-by: Mobashshera Rasool <mrasool@vmwaer.com>
2022-03-10 03:01:47 -08:00
Donald Sharp
4f138d5d8a
Merge pull request #10694 from opensourcerouting/pim6-nht-reenable
pim6d: reenable NHT code
2022-03-09 11:51:18 -05:00
Donatas Abraitis
1e02f2f9ab pimd: Add IGMP total groups and total source groups to statistics
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-08 19:07:57 +02:00
Mobashshera Rasool
ded5024af4 pim6d: Modify apis in pim_rpf.c for PIMv4/PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
fd5540ead6 pim6d: Modify pim_rp_find_exact and pim_rp_find_match_group
Modify the apis to accomodate IPv4 and IPv6 addreses for RP.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
9dca52b924 pim6d: Modify pim_rp_del for PIMv4/PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
1db07606ff pim6d: Modify pim_rp_find_prefix_list for PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
8eb5ad6c4a pim6d: Modify pim_rp_g for PIMv4/PIMv6
Modify pim_rp_g to support PIMv6.
Remove it from stub.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
131ded0891 pim6d: Modify pim_rp_i_am_rp for PIMv4/PIMv6
Remove pim_rp_i_am_rp from stub for PIMv6.
Modify pim_rp_i_am_rp for both the daemons.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
b1e132ac61 pim6d: Modify pim_rp_set_upstream_addr for PIMv4/PIMv6
Modify pim_rp_set_upstream_addr for supporting PIMv4 and PIMv6.
Removed the stub api for PIMv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
c6ced47492 pim6d: Add pim_get_all_mcast_group api
Added this api to fill all multicast group address based on IP version.
For PIMv4 its 224.0.0.0/4, for PIMv6 its FF00::0/8.
Changed the code where its being used currently.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
49b7b2c4a8 pim6d: Modify pim_rp_change api for pimv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
cafbb61955 pim6d: Convert %s to %pPA for RP Addresses
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
119fcc3def pim6d: Modify pim_*_cmd_worker api passing pim_addr parameter
Pass pim_addr as parameter for rp address to accomodate ipv6.
Modifying pim_rp_cmd_worker and pim_no_rp_cmd_worker function
parameters from in_addr to pim_addr.
Changes in the caller functions are done as well to make it work
for IPv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
6ed1cea1dc pim6d: Modify pim_rp_new for pimv6
Modify the api pim_rp_new to accomodate pimv6 changes.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
99384c6e4d pim6d: Return type and parameter changes for api pim_rp_del_config
1. Return value of this function pim_rp_del_config is nowhere used.
So made it as a void function.
2. Paramater const char *rp is first converted to string from prefix
in the caller and then back to prefix in this api pim_rp_del_config.
Fixed it by directly passing the address instead of string.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
4fc1f59ea7 pim6d: Stub BSM related APIs for compilation
Have stubbed few of the BSM related APIs to keep
PIMv6 compiling.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
e1a7c58ce2 pim6d: Add northbound changes for static rp
Parsing the inputs for static RP configuration.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
0c3182a08d pim6d: Adding the rp clis to show-running
Modify the pim_rp_config_write api for pimv4/pimv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
8663adc490 pim6d: Adding "ipv6 pim rp <> prefix-list <>" cli to pimv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
34b403cf8b pim6d: Add static RP CLI for PIMv6
Added the CLI to configure static RP configuration.
[no] ipv6 pim rp <rp-addr> [<group-addr/M>]

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:49 -08:00
Mobashshera Rasool
f39f349719 pimd: Modify "ip pim rp <> prefix-list <>" command
1. Moving the processing of the above command to an api.
2. Change DEFUN to DEPFY
3. Make the api common for pimv4 and pimv6 processing.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:54:49 -08:00
Mobashshera Rasool
a96942ca3e pim6d: Modify apis pim_process_rp_cmd for common processing
Modify the apis pim_process_rp_cmd and pim_process_no_rp_cmd
to accomodate ipv4 as well as ipv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:54:49 -08:00
Mobashshera Rasool
13ddf7cf74 pimd: Moving processing of "ip pim rp <grp>" cmd to a common api
1. Moving the processing of the command to a common api.
2. Changing the DEFUN to DEFPY.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:54:44 -08:00
David Lamparter
f4d8394b01
Merge pull request #10393 from patrasar/master_pimv6_cli 2022-03-08 09:46:31 +01:00
Mobashshera Rasool
ac529e18d4 pim6d: Initialise VRF related stuffs in Northbound
Not initialising it will lead to crash in nb_running_get_entry_worker.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-07 21:18:53 -08:00
Mobashshera Rasool
19ef44597d pim6d: Remove duplicate if_cmd_init
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-07 21:17:20 -08:00
David Schweizer
a533bb8cac
pimd/pim_cmd.c: fix typo in IGMP iface stats JSON
Changes correct typo in JSON output for IGMP interface statistics show
command from "leaveV3" to "leaveV2".

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2022-03-07 14:18:09 +01:00
Sai Gomathi
6d733f0dbc pimd: Added new option "detail" in the "debug pim nht" CLI
Problem Statement:
=================
PIM Logs are coming at interval of 1 minute although pim
is not enabled.

Root Cause Analysis:
====================
By default, RCPM configures the PIM debugs when router comes up
via script. The product cannot disable PIM even though it is not required.
Hence moving these logs under a new debug option which will not be
enabled by default.

Fix:
====
Added a new option "detail" in the cli:
debug pim nht detail

Co-author: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2022-03-03 22:33:20 -08:00
David Lamparter
0455229c5d pim6d: reenable NHT code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 11:01:47 +01:00
David Lamparter
bc97f40dff pim6d: fixup NHT code for IPv6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 11:01:46 +01:00
David Lamparter
6564f5e5a5 Merge pull request #10657 from patrasar/pim_remove_in_addr_none
[manual merge to edit comment, didn't want to incur another cycle]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 10:42:17 +01:00
David Lamparter
b369d0cc40 pimd: fix stray comment referencing INADDR_NONE
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 10:41:22 +01:00
David Lamparter
f2ec36de77
Merge pull request #10684 from mobash-rasool/join-prune 2022-03-02 09:29:02 +01:00
Jafar Al-Gharaibeh
5aad2b6a82
Merge pull request #10652 from mobash-rasool/fixes
pimd: FRR drops IGMP packets for TOS value other than 0XC0
2022-03-01 13:31:49 -06:00
sarita patra
cc144e8b6b pimd: replace inaddr_none with PIMADDR_ANY
We can use PIMADDR_ANY instead of INADDR_NONE to initalize rp->rpf_addr
when there is no rp configured for group_all.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 09:45:56 -08:00
sarita patra
63ee25c0ba pim6d: Adding ipv6 mroute INTERFACE X:X::X:X [X:X::X:X]" cli
This cli is used to add multicast route on interface

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:45 -08:00
sarita patra
52c52d7806 pim6d: Adding "ipv6 multicast boundary oil WORD" cli
This cli is used to define multicast boundary on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:45 -08:00
sarita patra
2b16b40fc7 pim6d: Adding "ipv6 pim sm" cli
This cli used to enable PIMV6 on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:44 -08:00
sarita patra
dab0ac2955 pim6d: Adding "ipv6 pim ssm" cli
This cli used to enable PIMV6 on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:44 -08:00
sarita patra
7e01b641ae pim6d: Adding "[no] ipv6 pim active-active" cli
This cli used to mark the interface as active-active.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:42 -08:00
sarita patra
e6aab61395 pim6d: Adding "ipv6 pim hello (1-65535) [(1-65535)]" CLI
This cli used to configure PIMV6 hello and hold timer on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:26:13 -08:00
sarita patra
bb387611c6 pim6d: Adding "ipv6 pim dr-priority" CLI
This cli used to configure PIMV6 dr-priority on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:24:16 -08:00
sarita patra
a1caf7a88f pim6d: Adding "ipv6 pim" CLI
This cli used to enable PIMV6 on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:24:14 -08:00
sarita patra
3e394a7729 pim6d: Handling pim_rpf for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:30:03 -08:00
sarita patra
113f29b90d pim6d: Handling last_lookup in pim_nexthop for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 18:03:12 -08:00
sarita patra
d4addb4839 pim6d: moving FRR_PIM_AF_XPATH_VAL into pim_nb.h
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 15:57:47 -08:00
Mobashshera Rasool
17280eee1f pimd: Handle pim join/prune recv flow for ipv6
Making the code changes to handle both ipv4 and ipv6 in the same code

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 10:36:04 -08:00
David Lamparter
ee95029ac4
Merge pull request #10424 from patrasar/master_pimv6_nht 2022-02-28 17:50:42 +01:00
sarita patra
90ab4458a1 pim6d: pim_nht changes for pimv6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 13:36:02 -08:00
David Lamparter
1917b9e480
Merge pull request #10639 from patrasar/master_pimv6_upstream 2022-02-28 14:10:44 +01:00
sarita patra
fd3af22930 pim6d: Handling IPV6 in pim_upstream
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 11:10:00 -08:00
Mobashshera Rasool
18ca7de516 pim6d: Add ipv6 pim register-suppress-time CLI
Adding below CLI for pim6d
[no] ipv6 pim register-suppress-time (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
2322b99150 pim6d: Adding ipv6 pim rp keep-alive-timer
Adding below CLI for pim6d daemon
[no] ipv6 pim rp keep-alive-timer [(1-65535)]

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
28e32366e3 pim6d: Adding ipv6 pim keep-alive-timer
Adding the below CLI for pim6d daemon:
ipv6 pim keep-alive-timer (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
0da72f1f59 pim6d: Adding ipv6 pim packet CLI
Adding below CLI for pim6d daemon:
[no] ipv6 pim packet (1-255)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
fb991ce9d4 pim6d: Adding ipv6 pim spt-switchover CLI
Adding the below CLIs for ipv6:
[no] ipv6 pim spt-switchover infinity-and-beyond
[no] ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
c73113ea9a pim6d: Implementing join-prune interval CLI
Adding "ipv6 pim join-prune interval (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
528311b5c8 pim6d: Add FRR_PIM_AF_XPATH_VAL for v4 and v6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
2328b7ef1e pimd: Moving pim_cli_get_vrf_name function to common file
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
26cd3d6612 pimd: Adding pim_cmd_common.h and .c
This is to keep the cmd changes common to v4 and v6 in this file.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
ae97d5777c pimd: Change the show running commands based on address family
Change the show running commands for pimv4 and pimv6 based on the
address family.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
fb908b01a0 pimd: Removing unnecessary #if
Since pim_cmd.c file is moved to pimv4 make file, therefore
removing #if PIM_IPV !=6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Sai Gomathi N
d17b6892fc pim6d: Adding show running for ipv6 mld commands
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
078c5867a1 pimd: Moving igmp "show running-config" to a function
Moving the igmp related commands running config to
a new function specific to pimv4.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
ebde3825c4 pim6d: Adding PIM_AF_NAME "ip" / "ipv6" for "show running-config"
Adding PIM_AF_NAME to use in the show running config for both
pimv4 and pimv6 commands.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Sai Gomathi N
0da95b2fd8 pimd: Moving ipv4 running-configs to a separate function
Co-authored-by: Sai Gomathi <nsaogimathi@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Sai Gomathi N
5d613d13b2 pim6d: Adding the base changes
Adding the file pim6_cmd.h and pim6d_cmd.c as the base changes
for implementing the CLI changes

Removed the pim_cmd_init from the stub file.

Co-authored-by: Sarita Patra <saritap@vmware.com>
Co-authored-by: Abhishek N R <abnr@vmware.com>
Co-authored-by: Sai Gomathi N <nsaigomathi@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:24 -08:00
David Lamparter
d7da6520e9
Merge pull request #10376 from patrasar/master_pimv6_vtysh 2022-02-28 10:26:22 +01:00
David Lamparter
8f26d9da67 pimd: fix unused variable
Fix `-Werror` build.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-26 15:32:48 +01:00
Donald Sharp
3bf65aa1ae
Merge pull request #10400 from opensourcerouting/pim6-compilefix
pim6d: get running with ipv6 types throughout
2022-02-26 08:03:06 -05:00
sarita patra
e8515e32a4 pim6d: Adding PIMV6 as VTYSH client
Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-25 06:08:42 -08:00
Mobashshera Rasool
baee5b57fc pimd: FRR drops IGMP packets for TOS value other than 0XC0
Currently the code is expecting the TOS value for received
packet to be 0xC0 and hence it is discarding packets having
TOS value other than 0xc0.

We need to make sure that we are sending the packet with
TOS 0xC0 and while receiving we can allow any TOS value.
Let's follow Postel's law.
Checked Cisco behavior as well. It also accepts all TOS values.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-24 22:10:52 -08:00
Christian Hopps
7bf63db79b
Merge pull request #10632 from donaldsharp/thread_return_null
*: Change thread->func to return void instead of int
2022-02-24 01:43:48 -05:00
Jafar Al-Gharaibeh
ca6c97340b
Merge pull request #10628 from anlancs/pimd-minors
pimd: cosmetic change
2022-02-23 23:26:58 -06:00
Donald Sharp
cc9f21da22 *: Change thread->func to return void instead of int
The int return value is never used.  Modify the code
base to just return a void instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23 19:56:04 -05:00
anlan_cs
de674e9fc2 pimd: cosmetic change
Remove one empty line. And correct one word.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-21 21:33:04 +08:00
Mobashshera Rasool
fcfd479d99 pimd: Do not allow 224.0.0.0/24 range in igmp join
224.0.0.0/24 cannot be used by igmp since this is reserved
for routing protocols and other low-level topology discovery or
maintenance protocols.

Fixes: #10614

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-20 22:21:31 -08:00
Donald Sharp
b5bf67e905
Merge pull request #10582 from anlancs/pimd-remove-redundant
pimd: remove redundant code
2022-02-17 08:06:14 -05:00
Donald Sharp
ccaa4cced2 pimd: Ensure timers are stopped on instance shutdown
The pim_upstream data structure has a ref count that is
not properly being incremented/decremented and when an
instance is removed this is causing crashes because timers
are still popping afterwords on data structures that are
now freed.

Since getting the ref count code is extremely hard and
we know that this crash is happening, add a bit of code
to prevent the timers from popping at all when we go
through and free up other data structures that we
are pointing at.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-17 07:52:33 -05:00
Mobashshera Rasool
dfc26ad186 pimd: Fix Compilation issue in PIM
A recent merge caused this, fixing it.

Signed-off-by: Mobashshera Rasool <mrasool@gmail.com>
2022-02-16 09:04:08 -08:00
Donald Sharp
7b08708e65
Merge pull request #9224 from SaiGomathiN/saig
pimd: IGMP Query Generation
2022-02-16 11:26:03 -05:00
David Lamparter
ae449dc594 pim6d: remove PIM_V6_TEMP_BREAK
It's no longer necessary, pim6d now compiles without this hack.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00
David Lamparter
94120cb227 pim6d: get into a kinda-working state wrt. zebra
Fix up just enough to make us not operate in complete darkness.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00
David Lamparter
b7f71639c9 pim6d: isolate remaining TODOs into stubs file
This creates `pim6_stubs.c`, which is intended to temporarily provide
stubbed-out definitions of some functions we don't have yet for IPv6.
This makes pim6d compile without the `PIM_V6_TEMP_BREAK` hack, and is
very important as an intermediate step to get a working environment for
further work.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00
David Lamparter
deb76ca4ce pim6d: drop off MLAG code 2022-02-16 16:40:56 +01:00
David Lamparter
5a46a3dea9 pim6d: drop off IGMP code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00
David Lamparter
809c11a9d8 pim6d: IPv6-adjust BSM code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00