Ignore ping packet on server

This commit is contained in:
Erik Ekman 2006-06-05 23:46:42 +00:00
parent 51bdcd9656
commit 5e7385a0ea
2 changed files with 5 additions and 1 deletions

2
dns.c
View File

@ -185,7 +185,7 @@ dns_ping(int dns_fd)
printf("No reply on chunk, resending\n"); printf("No reply on chunk, resending\n");
dns_send_chunk(dns_fd); dns_send_chunk(dns_fd);
} else { } else {
dns_write(dns_fd, dns_fd, "\0", 1); dns_write(dns_fd, dns_fd, "", 1);
} }
} }

4
dnsd.c
View File

@ -285,6 +285,10 @@ dnsd_read(int fd, char *buf, int buflen)
packetlen++; packetlen++;
} }
dnsd_respond(fd, id, from); dnsd_respond(fd, id, from);
if (lastblock && packetlen == 0) {
// Skipping ping packet
return 0;
}
if (lastblock) { if (lastblock) {
datalen = MIN(packetlen, buflen); datalen = MIN(packetlen, buflen);
memcpy(buf, activepacket, datalen); memcpy(buf, activepacket, datalen);