]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fixing coverity issues 9480/head
authorSai Gomathi <nsaigomathi@vmware.com>
Tue, 24 Aug 2021 17:40:03 +0000 (10:40 -0700)
committerSai Gomathi <nsaigomathi@vmware.com>
Tue, 24 Aug 2021 17:40:03 +0000 (10:40 -0700)
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 <nsaigomathi@vmware.com>
pimd/pim_pim.c

index 2c2aebc61f0301ca64544e0a4aba4062d89634f0..8c38cf6c4c382648edf73cab6c9a4ae9b0aaae80 100644 (file)
@@ -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) {