From bf21c8ac85dd29c5b9ee63c2f04c295c2c40eb63 Mon Sep 17 00:00:00 2001 From: Martin Wilke Date: Sat, 30 May 2009 18:43:33 +0000 Subject: The dnsreflector daemon listens for DNS queries on a local UDP port and answers with records pointing back to localhost. Combined with packet filter pf(4) this works as a bandwidth efficient spamtrap. WWW: http://www.wolfermann.org/dnsreflector.html PR: ports/135077 Submitted by: ismail.yenigul at endersys.com.tr --- dns/dnsreflector/files/patch-dnsreflector.c | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 dns/dnsreflector/files/patch-dnsreflector.c (limited to 'dns/dnsreflector/files/patch-dnsreflector.c') diff --git a/dns/dnsreflector/files/patch-dnsreflector.c b/dns/dnsreflector/files/patch-dnsreflector.c new file mode 100644 index 000000000000..b5c02658f476 --- /dev/null +++ b/dns/dnsreflector/files/patch-dnsreflector.c @@ -0,0 +1,40 @@ +--- dnsreflector.c.orig 2009-05-30 14:02:43.000000000 +0300 ++++ dnsreflector.c 2009-05-30 14:04:31.000000000 +0300 +@@ -87,8 +87,7 @@ + + #define MAXQUERY (PACKETSZ - sizeof(ADDITIONAL) - sizeof(AUTHORITY) - sizeof(ANSWER_AAAA)) + +-static struct syslog_data sdata = SYSLOG_DATA_INIT; +- ++static int daemonize = 0; + static void + logit(int level, const char *fmt, ...) + { +@@ -97,8 +96,8 @@ + + va_start(ap, fmt); + +- if (sdata.opened) { +- vsyslog_r(level, &sdata, fmt, ap); ++ if (daemonize) { ++ vsyslog(level, fmt, ap); + } else { + fprintf(stderr, "%s: ", __progname); + vfprintf(stderr, fmt, ap); +@@ -148,7 +147,6 @@ + + /* Options and their defaults */ + char *address = NULL; +- int daemonize = 0; + int port = 53000; + + /* Process commandline arguments */ +@@ -186,8 +184,6 @@ + /* Use syslog if daemonized */ + if (daemonize) { + tzset(); +- openlog_r("dnsreflector", LOG_PID | LOG_NDELAY, LOG_DAEMON, +- &sdata); + } + + /* Daemonize if requested */ -- cgit v1.2.3