inet_dgram_drop(): Fix control flow logic, found by Coverity Scan

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-12-24 10:31:19 +01:00
1 parent 3f731aa5a3
commit 6f665ab283
1 file changed
+3 -2
+3 -2
View File
@@ -76,14 +76,15 @@ static void inetd_dgram_drop(int sd, const char *ifname)
char pkt_interface[17]; char pkt_interface[17];
char buf[BUFSIZ]; char buf[BUFSIZ];
do { while (1) {
inetd_dgram_peek(sd, pkt_interface); inetd_dgram_peek(sd, pkt_interface);
if (string_compare(pkt_interface, ifname)) { if (string_compare(pkt_interface, ifname)) {
if (recv(sd, buf, sizeof(buf), 0) < 0) if (recv(sd, buf, sizeof(buf), 0) < 0)
break; break;
continue; continue;
} }
} while (0); break;
}
} }
/* Peek into SOCK_STREAM on accepted client socket to figure out inbound interface */ /* Peek into SOCK_STREAM on accepted client socket to figure out inbound interface */