]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/pvefw-logger.c
fixup changelog UNRELEASED
[pve-firewall.git] / src / pvefw-logger.c
index 3b79ed1ad08ea7fbd9fd01e5711a2ecc775e9c6b..2bd869c4afa86f36e92b5d0bd1938c4c89affd97 100644 (file)
@@ -753,9 +753,11 @@ static int print_pkt(struct log_entry *le, struct nflog_data *ldata, u_int8_t fa
     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);
@@ -923,7 +925,7 @@ main(int argc, char *argv[])
 
     gboolean wrote_pidfile = FALSE;
 
-    openlog("pvepw-logger", LOG_CONS|LOG_PID, LOG_DAEMON);
+    openlog("pvefw-logger", LOG_CONS|LOG_PID, LOG_DAEMON);
 
     GOptionContext *context;
 
@@ -982,7 +984,7 @@ main(int argc, char *argv[])
         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);
     }
@@ -994,7 +996,7 @@ main(int argc, char *argv[])
     }
 #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);
     }