Date: Tue, 25 Jan 2005 08:36:37 +0100 From: Daniel Hartmeier <daniel@benzedrine.cx> To: Nick Buraglio <nick@buraglio.com> Cc: freebsd-pf@freebsd.org Subject: Re: pftabled Message-ID: <20050125073637.GF7366@insomnia.benzedrine.cx> In-Reply-To: <8B6F7B50-6E8A-11D9-98FB-000393B61F2E@buraglio.com> References: <8B6F7B50-6E8A-11D9-98FB-000393B61F2E@buraglio.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 24, 2005 at 10:35:30PM -0600, Nick Buraglio wrote: > Anyone gotten pftabled ( http://www.wolfermann.org/pftabled.html )to > compile on freebsd 5.3? I find it immensely useful under openbsd for > managing tables but under free it bombs with > > pftabled.c:53: error: variable `sdata' has initializer but incomplete > type > > I don't really know c, but I think it means that there is something > defined in a struct that isn't being found where it's expected. It's using the reentrant syslog functions from OpenBSD. Since they're not called from a signal handler, that's not really needed. You can just switch to the standard versions with the patch below, which builds on FreeBSD 5.3. Daniel --- ../pftabled-1.04.orig/pftabled.c Sun Sep 12 17:53:22 2004 +++ pftabled.c Tue Jan 25 08:37:02 2005 @@ -50,7 +50,7 @@ #define PFDEV "/dev/pf" static int pfdev = -1; -static struct syslog_data sdata = SYSLOG_DATA_INIT; +static int daemonize = 0; static int timeout = 0; @@ -70,8 +70,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); @@ -194,7 +194,6 @@ /* Options and their defaults */ char *address = NULL; - int daemonize = 0; char *forced = NULL; char key[SHA1_DIGEST_LENGTH]; int port = 56789; @@ -264,7 +263,6 @@ /* Daemonize if requested */ if (daemonize) { tzset(); - openlog_r("pftabled", LOG_PID|LOG_NDELAY, LOG_DAEMON, &sdata); if (daemon(0, 0) == -1) err(1, "daemon");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050125073637.GF7366>
