[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: build problems, snapshot 2003-12-13
Mans Nilsson <mansaxel@sunet.se> writes:
> Hi,
Hej
> /bin/bash ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../lib/roken -I../../lib/roken -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -g -O2 -c -o resolve.lo `test -f 'resolve.c' || echo './'`resolve.c
> gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../lib/roken -I../../lib/roken -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -g -O2 -c resolve.c -o resolve.o
This changes the abi and this will result in a major version bump of
libroken.
Love
diff -u lib/roken/resolve.c
--- lib/roken/resolve.c 11 Jul 2003 15:41:40 -0000 1.40
+++ lib/roken/resolve.c 13 Dec 2003 20:22:07 -0000
@@ -354,14 +354,17 @@
return NULL;
p = data;
-#if 0
- /* doesn't work on Crays */
- memcpy(&r->h, p, sizeof(HEADER));
- p += sizeof(HEADER);
-#else
memcpy(&r->h, p, 12); /* XXX this will probably be mostly garbage */
+
+ r->h.id = (p[0] << 8) | p[1];
+ r->h.misc = (p[2] << 8) | p[3];
+ r->h.qdcount = (p[4] << 8) | p[5];
+ r->h.ancount = (p[6] << 8) | p[7];
+ r->h.nscount = (p[8] << 8) | p[9];
+ r->h.arcount = (p[10] << 8) | p[11];
+
p += 12;
-#endif
+
if(ntohs(r->h.qdcount) != 1) {
free(r);
return NULL;
diff -u lib/roken/resolve.h
--- lib/roken/resolve.h 6 Dec 2003 16:51:33 -0000 1.16
+++ lib/roken/resolve.h 13 Dec 2003 19:59:47 -0000
@@ -176,12 +176,12 @@
#endif
struct dns_header {
- u_int16_t id;
- u_int16_t misc;
- u_int16_t qdcount;
- u_int16_t ancount;
- u_int16_t nscount;
- u_int16_t arcount;
+ unsigned id;
+ unsigned misc;
+ unsigned qdcount;
+ unsigned ancount;
+ unsigned nscount;
+ unsigned arcount;
};
struct dns_reply{
PGP signature