LEPRINTF("%s ", chain_name);
struct timeval ts;
- nflog_get_timestamp(ldata, &ts);
-
- LEPRINTTIME(ts.tv_sec);
+ if (nflog_get_timestamp(ldata, &ts) == 0) {
+ LEPRINTTIME(ts.tv_sec);
+ } else {
+ LEPRINTTIME(time(NULL));
+ }
if (prefix != NULL) {
LEPRINTF("%s", prefix);
gboolean wrote_pidfile = FALSE;
- openlog("pvepw-logger", LOG_CONS|LOG_PID, LOG_DAEMON);
+ openlog("pvefw-logger", LOG_CONS|LOG_PID, LOG_DAEMON);
GOptionContext *context;
exit(-1);
}
- if (!nflog_bind_pf(logh, AF_INET) <= 0) {
+ if (nflog_bind_pf(logh, AF_INET) < 0) {
fprintf(stderr, "nflog_bind_pf AF_INET failed\n");
exit(-1);
}
}
#endif
- if (!nflog_bind_pf(logh, AF_BRIDGE) <= 0) {
+ if (nflog_bind_pf(logh, AF_BRIDGE) < 0) {
fprintf(stderr, "nflog_bind_pf AF_BRIDGE failed\n");
exit(-1);
}