From 50975049f3722cc2b06f1a640b61da1bdfe5acf7 Mon Sep 17 00:00:00 2001 From: Sai Gomathi Date: Tue, 24 Aug 2021 10:40:03 -0700 Subject: [PATCH] pimd: Fixing coverity issues Problem ====== In pim_msg_send_frame api, the while loop was executed only once. Fix === while is changed to if, as in the code flow the while part is getting executed only once. Signed-off-by: Sai Gomathi --- pimd/pim_pim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 2c2aebc61f..8c38cf6c4c 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -513,7 +513,7 @@ static int pim_msg_send_frame(int fd, char *buf, size_t len, { struct ip *ip = (struct ip *)buf; - while (sendto(fd, buf, len, MSG_DONTWAIT, dst, salen) < 0) { + if (sendto(fd, buf, len, MSG_DONTWAIT, dst, salen) < 0) { char dst_str[INET_ADDRSTRLEN]; switch (errno) { -- 2.39.5