Panther DNS Issues

From Wikifications
Revision as of 17:28, 16 April 2005 by Dre (Talk | contribs) (initial rev from backup)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

One annoying thing about Panther is the number of unix packages that will fail to compile, citing DNS related problems during the make.

e.g.

gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -Wall -c `test -f dns.c || echo './'`dns.c
dns.c:234: error: `PACKETSZ' undeclared here (not in a function)
dns.c: In function `dorequest':
dns.c:817: error: `PACKETSZ' undeclared (first use in this function)
dns.c:817: error: (Each undeclared identifier is reported only once
dns.c:817: error: for each function it appears in.)
dns.c:819: error: `QUERY' undeclared (first use in this function)
dns.c:819: error: `C_IN' undeclared (first use in this function)
dns.c:817: warning: unused variable `buf'
dns.c: In function `resendrequest':
dns.c:833: error: `T_A' undeclared (first use in this function)
dns.c:840: error: `T_PTR' undeclared (first use in this function)
dns.c: In function `parserespacket':
dns.c:938: error: `NOERROR' undeclared (first use in this function)
dns.c:965: error: `MAXDNAME' undeclared (first use in this function)
dns.c:990: error: `C_IN' undeclared (first use in this function)
dns.c:997: error: `T_PTR' undeclared (first use in this function)
dns.c:1057: error: `T_CNAME' undeclared (first use in this function)
dns.c:1064: error: `T_A' undeclared (first use in this function)
dns.c:1140: error: `NXDOMAIN' undeclared (first use in this function)
dns.c: In function `dns_ack':
dns.c:1160: error: `PACKETSZ' undeclared (first use in this function)
dns.c: In function `dns_events':
dns.c:1215: error: `T_PTR' undeclared (first use in this function)
dns.c: In function `dns_lookup2':
dns.c:1277: error: `T_PTR' undeclared (first use in this function)
/usr/include/ctype.h: At top level:
dns.c:234: error: storage size of `resrecvbuf' isn't known
make[2]: *** [dns.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The solution?

replacing any instance of

#include <arpa/nameser.h>

with

#include <arpa/nameser_compat.h>

and also adding -lresolv to the LIBS section in the Makefile

These steps have been tested to work with mtr, but would probably also work elsewhere.