fixed dnsd answer

This commit is contained in:
Bjorn Andersson 2006-06-06 00:07:25 +00:00
parent e24f396039
commit 781545dd02

14
dnsd.c
View file

@ -208,14 +208,18 @@ dnsd_respond(int fd, short id, struct sockaddr_in from)
p += host2dns("fluff", p, 5); p += host2dns("fluff", p, 5);
PUTSHORT(T_NULL, p); PUTSHORT(T_NULL, p);
PUTSHORT(C_IN, p); PUTSHORT(C_IN, p);
PUTLONG(htons(3600), p); PUTLONG(htons(0), p);
size = host2dns(outbuf, p+2, outbuflen); //size = host2dns(outbuf, p+2, outbuflen);
PUTSHORT(size, p); PUTSHORT(outbuflen, p);
p += size; memcpy(p, outbuf, outbuflen);
p += outbuflen;
int f;
f = open("moo", O_WRONLY | O_CREAT,
len = p - buf; len = p - buf;
printf("%d\n", len);
sendto(fd, buf, len, 0, (struct sockaddr*)&from, sizeof(from)); sendto(fd, buf, len, 0, (struct sockaddr*)&from, sizeof(from));
outbuflen = 0; outbuflen = 0;