- if (udpaddrlen != sizeof(udpaddr)) {
- adns__diag(ads,-1,0,"datagram received with wrong address length %d"
- " (expected %lu)", udpaddrlen,
- (unsigned long)sizeof(udpaddr));
- continue;
- }
- if (udpaddr.sin_family != AF_INET) {
- adns__diag(ads,-1,0,"datagram received with wrong protocol family"
- " %u (expected %u)",udpaddr.sin_family,AF_INET);
- continue;
- }
- if (ntohs(udpaddr.sin_port) != DNS_PORT) {
- adns__diag(ads,-1,0,"datagram received from wrong port"
- " %u (expected %u)", ntohs(udpaddr.sin_port),DNS_PORT);
- continue;
- }