diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2009-05-30 18:43:33 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2009-05-30 18:43:33 +0000 |
commit | bf21c8ac85dd29c5b9ee63c2f04c295c2c40eb63 (patch) | |
tree | 192e1c2652391c0a4880ab4e34d5f7d3ca569642 /dns/dnsreflector/files/patch-dnsreflector.c | |
parent | - Update to 2.0.11 (diff) |
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
Diffstat (limited to 'dns/dnsreflector/files/patch-dnsreflector.c')
-rw-r--r-- | dns/dnsreflector/files/patch-dnsreflector.c | 40 |
1 files changed, 40 insertions, 0 deletions
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 */ |