From 1d2da42f93ff4d7de0214f56bbc96d4def475fdb Mon Sep 17 00:00:00 2001
From: Martin Josefsson <gandalf@netfilter.org>
Date: Sun, 11 Jul 2004 03:49:02 -0700
Subject: [PATCH] [NETFILTER]: Add timestamping to ipt_ULOG

After Andi's timestamp optimizations we don't have any timestamps on the
packets unless someone requested them. Here's a patch for 2.6 to
explicitly timestamp the packets before we log them.

Harald approved it some time ago, he's pretty busy so I'm sending it
instead.

Signed-off-by: Martin Josefsson <gandalf@netfilter.org>
Signed-off-by: David S. Miller <davem@redhat.com>
---
 net/ipv4/netfilter/ipt_ULOG.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index b041d28e7eac..c352df54aa1f 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -217,6 +217,10 @@ static void ipt_ulog_packet(unsigned int hooknum,
 
 	pm = NLMSG_DATA(nlh);
 
+	/* We might not have a timestamp, get one */
+	if (skb->stamp.tv_sec == 0)
+		do_gettimeofday((struct timeval *)&skb->stamp);
+
 	/* copy hook, prefix, timestamp, payload, etc. */
 	pm->data_len = copy_len;
 	pm->timestamp_sec = skb->stamp.tv_sec;
-- 
2.30.9