From owner-freebsd-current Wed Feb 28 3:25:58 2001 Delivered-To: freebsd-current@freebsd.org Received: from zibbi.icomtek.csir.co.za (zibbi.icomtek.csir.co.za [146.64.24.58]) by hub.freebsd.org (Postfix) with ESMTP id BFD6737B718 for ; Wed, 28 Feb 2001 03:25:49 -0800 (PST) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: (from jhay@localhost) by zibbi.icomtek.csir.co.za (8.11.1/8.11.1) id f1SBPiM51551 for current@FreeBSD.org; Wed, 28 Feb 2001 13:25:44 +0200 (SAT) (envelope-from jhay) From: John Hay Message-Id: <200102281125.f1SBPiM51551@zibbi.icomtek.csir.co.za> Subject: resolver problem with shared linked programs To: current@FreeBSD.org Date: Wed, 28 Feb 2001 13:25:44 +0200 (SAT) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I noticed that sendmail started to complain of a failed reverse lookup when starting: Feb 28 11:40:43 beast sendmail[276]: gethostbyaddr(3ffe:2900:fffa:2:2a0:c9ff:fe8d:7c5f) failed: 2 At first I thought something is wrong with my ipv6 dns setup, but it turned out that if a program is linked shared the first getipnodebyaddr() it does will succeed, but the rest fail. For a staticly linked program all of them will succeed: ######## beast:~/try > cc -Wall -static -O -o tstgetipnodebyaddr.static-c tstgetipnodebyaddr.c beast:~/try > cc -Wall -O -o tstgetipnodebyaddr tstgetipnodebyaddr.c beast:~/try > ./tstgetipnodebyaddr.static-c And the answer is: beast.icomtek.csir.co.za And the answer is: beast.icomtek.csir.co.za beast:~/try > ./tstgetipnodebyaddr And the answer is: beast.icomtek.csir.co.za Oops: 2. getipnodebyaddr: Host name lookup failure beast:~/try > ######## My test program is at the end of the email. Maybe I (and sendmail) have done something wrong? John -- John Hay -- John.Hay@icomtek.csir.co.za #include #include #include #include #include #include int main(int argc, char **argv) { struct hostent *he; int h_err; u_char ipnum[16]; char *astr1; astr1 = "146.64.24.3"; h_err = inet_pton(AF_INET, astr1, ipnum); if(h_err == 0) { printf("conversion error with inet_pton()\n"); exit(1); } he = getipnodebyaddr(ipnum, 4, AF_INET, &h_err); if(he == NULL) { printf("Oops: %d.\n", h_err); herror("getipnodebyaddr"); } else printf("And the answer is: %s\n", he->h_name); he = getipnodebyaddr(ipnum, 4, AF_INET, &h_err); if(he == NULL) { printf("Oops: %d.\n", h_err); herror("getipnodebyaddr"); } else printf("And the answer is: %s\n", he->h_name); return 0; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message