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
2017-12-24 10:31:19 +01:00
parent 3f731aa5a3
commit 6f665ab283
+3 -2
View File
@@ -76,14 +76,15 @@ static void inetd_dgram_drop(int sd, const char *ifname)
char pkt_interface[17];
char buf[BUFSIZ];
do {
while (1) {
inetd_dgram_peek(sd, pkt_interface);
if (string_compare(pkt_interface, ifname)) {
if (recv(sd, buf, sizeof(buf), 0) < 0)
break;
continue;
}
} while (0);
break;
}
}
/* Peek into SOCK_STREAM on accepted client socket to figure out inbound interface */