static void
log_status_message(guint loglevel, const char *fmt, ...)
{
- va_list ap;
- va_start(ap, fmt);
+ va_list ap, ap2;
if (loglevel > 7 ) loglevel = 7; // syslog defines level 0-7
LEPRINTTIME(time(NULL));
+ va_start(ap, fmt);
+ va_copy(ap2, ap);
le->len += vsnprintf(le->buf + le->len, LE_MAX - le->len, fmt, ap);
+ va_end(ap);
LEPRINTF("\n");
// also log to syslog
- vsyslog(loglevel, fmt, ap);
+ vsyslog(loglevel, fmt, ap2);
+ va_end(ap2);
}
static int
{
int res;
if ((res = nfct_catch(nfcth)) < 0) {
- log_status_message(3, "error catching nfct");
- return FALSE;
+ if (errno == ENOBUFS) {
+ log_status_message(3, "nfct_catch returned ENOBUFS: conntrack information may be incomplete");
+ } else {
+ log_status_message(3, "error catching nfct: %s", strerror(errno));
+ return FALSE;
+ }
}
return TRUE;
}