applied... On Mon, Sep 04, 2017 at 12:43:04PM +0200, Wolfgang Bumiller wrote: > There's no guarantee that there's a timestamp in an skb, so > nflog_get_timestamp can fail. > --- > Alternatively we could leave out the timestamp entirely in this case, > but then the gui won't show any timestamps at all in the firewall log > tab. > > src/pvefw-logger.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/src/pvefw-logger.c b/src/pvefw-logger.c > index 3dc40eb..12ada77 100644 > --- a/src/pvefw-logger.c > +++ b/src/pvefw-logger.c > @@ -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); > -- > 2.11.0
_______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel