Commit Graph

2718 Commits

Author SHA1 Message Date
Donatas Abraitis
253135ca2c
Merge pull request #13765 from AbhishekNR/query-max-response-time
pim6d: Correcting the help string
2023-06-18 11:48:29 +03:00
Mobashshera Rasool
8ebcc02328 pimd,pim6d: Correct the socket to send reg-stop msg
We were using the pim interface socket to send the register
stop msg, it works fine in cases where the interface on which
register msg is received and the interface on which the register-stop
msg is supposed to be sent is the same.
But when the interfaces are different, msg send fails because
the outgoing interface is not right.

Fixes: #13774

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2023-06-12 22:51:44 -07:00
Abhishek N R
0140d07739 pim6d: Correcting the help string
Max response time in the code is being used as decisecond but the user input is taken in millisecond.
Also yang expects the field to be in decisecond.
The below condition in yang is failing due to the mismatch in units.

```
units deciseconds;
must ". <= ../query-interval * 10";
```

Issue: #11892

Signed-off-by: Abhishek N R <abnr@vmware.com>
2023-06-11 21:54:24 -07:00
mobash-rasool
a19aa56b95
Merge pull request #13727 from anlancs/pimd/cleanup-1
pimd: adjust the display for debug
2023-06-09 22:30:44 +05:30
Donatas Abraitis
ff73a7bdbe
Merge pull request #13664 from routingrocks/pim_nb_fix
pimd: Change in PIM northbound error, when a path to RP is not found …
2023-06-08 20:16:32 +03:00
Donatas Abraitis
99bd15405c
Merge pull request #13421 from mobash-rasool/igmp-ups2
pimd, pim6d: re-arrange some code and pimv6 deletion flow fix
2023-06-08 10:46:38 +03:00
anlan_cs
beb7c1a710 pimd: adjust the display for debug
The vrf name should be separated when it is displayed. And remove
unnecessary space after number.

Before:
```
pim_upstream_sg_running: (100.100.1.100,232.100.100.100)x is not installed in mroute
pim_upstream_del(pim_ifchannel_delete): Delete (100.100.1.100,232.100.100.100)[x] ref count: 1 , flags: 1048585 c_oil ref count 2 (Pre decrement)
```

After:
```
pim_upstream_sg_running: (100.100.1.100,232.100.100.100)[x] is not installed in mroute
pim_upstream_del(pim_ifchannel_delete): Delete (100.100.1.100,232.100.100.100)[x] ref count: 1, flags: 1048585 c_oil ref count 2 (Pre decrement)
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-06-08 10:21:49 +08:00
Mobashshera Rasool
b25286add3 pimd, pim6d: Move mld/igmp deletion code to a common api
Move the mld/igmp deletion common code to api pim_gm_interface_delete
code for IPv6 deletion(gm_ifp_teardown) for MLD was missing in this flow
Making the code common fixes this too.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2023-06-07 00:01:05 -07:00
Mobashshera Rasool
692b1f3e97 pimd, pim6d: Rename and move api pim_cmd_interface_delete
Rename pim_cmd_interface_delete to pim_pim_interface_delete
and move the api to pimd/pim_iface.c

Changed the return type of the api from int to void.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2023-06-06 23:59:55 -07:00
Mobashshera Rasool
e7356fdba1 pimd, pim6d: Move api pim_if_membership_clear
Move pim_if_membership_clear api from pimd/pim_nb_config.c
to pimd/pim_iface.c
Also fixed curly braces warning
WARNING: braces {} are not necessary for single statement blocks
1773: FILE: /tmp/f1-127504/pim_iface.c:1773:

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2023-06-06 23:58:29 -07:00
Sarita Patra
8e595849fc pimd: remove api source_channel_oil_detach()
This API is no more in use.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-06-04 22:23:56 -07:00
Sarita Patra
cb809c0d6c pim6d: Clear channel_oil on prune
Receiver---LHR---RP

Problem:
In LHR, ipv6 pim state remains after MLD prune received.

Root Cause:
When LHR receives join, it creates (*,G) channel oil with
oil_ref_count = 2. The channel_oil is used by gm_sg sg->oil
and upstream->channel_oil.

When LHR receives prune, currently upstream->channel_oil is
deleted and gm_sg sg->oil still present. Due to this channel_oil
is still present with oil_ref_count = 1

Fix:
When LHR receives prune, upstream->channel_oil and pim_sg sg->oil
needs to be deleted.

Issue: #11249

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-06-04 22:23:56 -07:00
Rajesh Varatharaj
314a97c164 pimd: Change in PIM northbound error, when a path to RP is not found during config apply
Currently, in PIM Northbound, when a path to RP is not found during config apply, we are treating this as a NB_ERR_INCONSISTENCY.
However, there are two issues with this approach:

When OSPF or IGP convergence is completed, it is possible that the RPF check will succeed.
If we have multiple groups and RPs (e.g. 50 RPs), we will receive 50 logs with inconsistency errors.
example:

2023/05/27 22:57:45 PIM: [G822R-SBMNH] config-from-file# ip pim rp 192.168.100.1 239.100.0.0/28 2023/05/27 22:57:45
PIM: [VAKV3-NMY7B][EC 100663337] error processing configuration change: error [internal inconsistency] event [apply]
operation [create] xpath [/frr-routing:routing/control-plane-protocols/control-plane-protocol[type='frr-pim:pimd']
[name='pim'][vrf='default']/frr-pim:pim/address-family[address-family='frr-routing:ipv4']/frr-pim-rp:rp/static-rp/rp-list
[rp-address='192.168.100.1']/group-list[.='239.100.0.0/28']] message: No Path to RP address specified: 192.168.100.1

Issue: #13620
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2023-06-01 16:13:51 -07:00
Donatas Abraitis
8d4eeb9026
Merge pull request #13450 from patrasar/mld_core
pim6d: Fix crash in ipv6 pim command
2023-06-01 09:13:30 +03:00
Sarita Patra
6d1d2c27a3 pim6d: Fix crash in ipv6 pim command
Problem:
Execute the below commands, pim6d core happens.
interface ens193
 ip address 69.0.0.2/24
 ipv6 address 8000::1/120
 ipv6 mld
 ipv6 pim
We see crash only if the interface is not configured, and
we are executing PIM/MLD commands.

RootCause:
Interface ens193 is not configured. So, it will have
ifindex = 0 and mroute_vif_index = -1.
Currently, we don't enable MLD on an interface if
mroute_vif_index < 0. So, pim_ifp->MLD = NULL.
In the API pim_if_membership_refresh(), we are accessing
pim_ifp->MLD NULL pointer which leads to crash.

Fix:
Added NULL check before accessing pim_ifp->MLD pointer in
the API pim_if_membership_refresh().

Issue: #13385

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-05-30 00:43:45 -07:00
Donald Sharp
06504bea79 pimd: When doing json output do not output non-json strings
When entering some show commands that use json in pimd
when the interface cannot be found do not output non-json
format in that case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-28 07:37:25 -04:00
anlan_cs
f403844a12 pimd: Use macro for pimreg interface
Some interfaces are special, they have the same `ifindex` with pimreg.
Use macro for `ifindex` of pimreg.

And adjust log.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-05-11 13:52:25 +08:00
Mark Stapp
efa2a5f8ad pimd: replace CPP_NOTICE lines with TODO comments
Replace the noisy CPP_NOTICE lines with TODO comments.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-05-04 10:26:33 -04:00
Donald Sharp
42f5ab16ec pimd: Fix old commit that got in
An old fix that used THREAD_OFF was pushed in, should
have used EVENT_OFF instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-02 14:49:32 -04:00
Donald Sharp
f7a775a78e
Merge pull request #13020 from SaiGomathiN/2462808-3
pimd: PIM not sending register packets after changing from non DR to DR
2023-05-02 11:55:34 -04:00
anlan_cs
ad855cdf34 pimd: Fix wrong setsockopt() call
`setsockopt()` should be only called once with `MRT_TABLE`
in "enable" case, otherwise it will fail.  In current code,
`mroute_socket` of "pim instance" with VRF can't be correctly
closed.

Skip it in the "disable" case to let `mroute_socket` safely
closed.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-27 09:15:00 +08:00
Donald Sharp
f662a4194d
Merge pull request #13349 from opensourcerouting/pim6-mld-coverity-20230421
pimd: address some static analysis complaints
2023-04-22 11:02:51 -04:00
David Lamparter
54c037a187 pimd: annotate some pointers as non-null
... make static analysis happy.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-21 15:30:43 +02:00
David Lamparter
ac4304d0fa pimd: harden MLD code loop boundaries
Coverity complains about these being tainted/untrusted loop boundaries.
The way the code works, it's counting up groups/sources, but keeps
checking against remaining data length in the packet - which is
perfectly fine IMHO.  Except Coverity doesn't understand it :(

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-21 15:30:43 +02:00
Donald Sharp
35801e6234 pimd: Tell coverity what is really going on
Fix a code path that coverity has decided a variable
is NULL when it never can be.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-21 07:38:11 -04:00
Donald Sharp
db865bf6ed pimd: Fix possible null of pim instance
Coverity shows a path where the pim instance may
be null.  In this code path if we have no pim
vrf there is nothing to do anyway so just return

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-21 07:08:53 -04:00
mobash-rasool
74aad5ab55
Merge pull request #13319 from anlancs/pimd-wrong-comment-nht
pimd: Correct the wrong comment
2023-04-18 00:07:04 +05:30
Donatas Abraitis
e7fd314f06
Merge pull request #12550 from AbhishekNR/mld_join
pim6d: Implementing "ipv6 mld join"
2023-04-17 11:01:21 +03:00
anlan_cs
3d8814f827 pimd: Correct the wrong comment
Currently the function `pim_parse_nexthop_update()` clearly
updates nexthop interfaces even as PIM-disabled.

Just correct the wrong comments about those PIM-disabled interfaces
to avoid misleading.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-17 09:07:37 +08:00
David Lamparter
5903e49c7b pimd, doc: remove dead import check references
ZEBRA_IMPORT_CHECK_UPDATE has been gone for more than a year; remove
some leftover dead references to it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-13 16:52:57 +02:00
Donald Sharp
635d65e2c8
Merge pull request #13097 from AbhishekNR/mroute
pim6d: mroutes not created after disabling and enabling PIMv6.
2023-04-13 07:41:49 -04:00
Donald Sharp
b1fe933c60
Merge pull request #13244 from patrasar/pim_bsm
pimd: Process no-forward BSM packet
2023-04-13 07:36:52 -04:00
Jafar Al-Gharaibeh
7a29a05023
Merge pull request #13183 from Pdoijode/pdoijode/pim-json-changes
pimd: Option to get IGMP groups and sources for a particular interface
2023-04-11 23:46:18 -05:00
Pooja Jagadeesh Doijode
5519cabe4c pimd: Option to get IGMP groups and sources for a particular interface
1. Added interface name, group address and detail option to existing
   "show ip igmp groups" so that user can retrieve all the groups
   or a particular group for an interface. Detail option shows the source
   information for the group. With that, the show command
   looks like:

   "show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail$detail] [json$json]"

2. Changed pim_cmd_lookup_vrf() to return empty JSON if VRF is not present

3. Changed "detail" option to print non pretty JSON

4. Added interface name and group address to existing
   "show ip igmp sources" so that user can retrieve all the sources for
   all the groups or, all the sorces for a particular group for an
   interface. With that, the show command looks like:

   "show ip igmp [vrf NAME$vrf_name] sourcess [INTERFACE$ifname [GROUP$grp_str]] [json$json]"

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-04-11 11:00:39 -07:00
Sarita Patra
8b462d5579 pimd: Process no-forward BSM packet
Topology Used:
=============
Cisco---FRR4----FRR2

Initially PIM nbr is down between FRR4----FRR2 from FRR2 side
Cisco is sending BSR packet to FRR4.

Problem Statement:
=================
No shutdown the PIM neighbor on FRR2 towards FRR4.
FRR2, receives BSR packet immediately as the new neighbor
comes up. This BSR packet is having no-forward bit set.
FRR2 is not able to process the BSR packet, and drop the
BSR packet.

Root Cause:
==========
When PIMD comes up, we start BSM timer for 60 seconds.
Here, the value accept_nofwd_bsm is setting to false.

FRR2, when receives no-forward BSR packet, it is getting
accept_nofwd_bsm value as false.

So, it drops, the no-forward BSM packet.

Fix:
===
Set accept_nofwd_bsm as false after first BSM packet received.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-04-09 22:30:44 -07:00
Abhishek N R
b1076c14af pim6d: Fixing ipv6 mld join cli error
frr(config-if)# ipv6 mld join ffaa::1
Invalid Multicast Address

Cli was not accepting valid addresses.

Issue: #12822

Signed-off-by: Abhishek N R <abnr@vmware.com>
2023-04-03 04:05:26 -07:00
Abhishek N R
bd2c824a21 pim6d: Impelmenting "ipv6 mld join"
Fixes: #12014

Signed-off-by: Abhishek N R <abnr@vmware.com>
2023-04-03 04:05:17 -07:00
Donald Sharp
4979c877b3
Merge pull request #13017 from SaiGomathiN/12744
pim6d: Do not use interfaces with ifindex as 0
2023-03-31 07:50:20 -04:00
Donatas Abraitis
6bfb662245
Merge pull request #12931 from SaiGomathiN/yang
pim6d: custom error-message for non-multicast groups
2023-03-27 13:45:00 +03:00
Jafar Al-Gharaibeh
06f54ff416
Merge pull request #12953 from donaldsharp/struct_event
Struct event
2023-03-24 13:48:53 -05:00
mobash-rasool
18c9215985
Merge pull request #13088 from donaldsharp/pim_use_after
pimd: Fix use after free issue for ifp's moving vrfs
2023-03-24 18:33:05 +05:30
Donald Sharp
24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
4f830a0799 *: Convert thread_timer_remain_XXX to event_timer_remain_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
8c1186d38e *: Convert thread_execute to event_execute
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
332beb64b8 *: Convert thread_cancelXXX to event_cancelXXX
Modify the code base so that thread_cancel becomes event_cancel

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00