From 781545dd022ead68f89d357fd548d46fc332ac2c Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Tue, 6 Jun 2006 00:07:25 +0000 Subject: [PATCH] fixed dnsd answer --- dnsd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dnsd.c b/dnsd.c index 562831f..bcf5f88 100644 --- a/dnsd.c +++ b/dnsd.c @@ -208,14 +208,18 @@ dnsd_respond(int fd, short id, struct sockaddr_in from) p += host2dns("fluff", p, 5); PUTSHORT(T_NULL, p); PUTSHORT(C_IN, p); - PUTLONG(htons(3600), p); + PUTLONG(htons(0), p); - size = host2dns(outbuf, p+2, outbuflen); - PUTSHORT(size, p); - p += size; + //size = host2dns(outbuf, p+2, outbuflen); + PUTSHORT(outbuflen, p); + memcpy(p, outbuf, outbuflen); + p += outbuflen; + + int f; + + f = open("moo", O_WRONLY | O_CREAT, len = p - buf; - printf("%d\n", len); sendto(fd, buf, len, 0, (struct sockaddr*)&from, sizeof(from)); outbuflen = 0;