diff mbox series

[ovs-dev,v2,2/8] cfm: Fix possible integer overflow in tc_add_matchall_policer().

Message ID 15ce15feb4d19877ab1f19fc6af4ae7945f6dfaa.1716896375.git.echaudro@redhat.com
State Changes Requested
Headers show
Series Coverity fixes. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Eelco Chaudron May 28, 2024, 11:39 a.m. UTC
Fix unintentional integer overflow reported by Coverity by adding
the LL suffix to the numerical literals used in the multiplication.

Fixes: 5767a79a4059 ("cfm: Require ccm received in demand mode.")
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
---
 lib/cfm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mike Pattrick May 28, 2024, 5:16 p.m. UTC | #1
On Tue, May 28, 2024 at 7:46 AM Eelco Chaudron <echaudro@redhat.com> wrote:
>
> Fix unintentional integer overflow reported by Coverity by adding
> the LL suffix to the numerical literals used in the multiplication.
>
> Fixes: 5767a79a4059 ("cfm: Require ccm received in demand mode.")
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>

Acked-by: Mike Pattrick <mkp@redhat.com>
diff mbox series

Patch

diff --git a/lib/cfm.c b/lib/cfm.c
index c3742f3de..7eb080157 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -863,7 +863,7 @@  cfm_process_heartbeat(struct cfm *cfm, const struct dp_packet *p)
                 rmp->num_health_ccm++;
                 if (cfm->demand) {
                     timer_set_duration(&cfm->demand_rx_ccm_t,
-                                       100 * cfm->ccm_interval_ms);
+                                       100LL * cfm->ccm_interval_ms);
                 }
             }
             rmp->recv = true;