freebsd-ports/dns/dnsreflector/files/patch-dnsreflector.c
Martin Wilke bf21c8ac85 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
2009-05-30 18:43:33 +00:00

40 lines
960 B
C

--- 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 */