[PATCH 2.6.20 10/10] nfnetlink_log: enable packet timestamps

Michał Mirosław mirq-linux at rere.qmqm.pl
Mon Feb 12 01:40:42 CET 2007


It's nice to log packet arrival time of those little filthy packets. ;)

Signed-off-by: Michał Mirosław <mirq-linux at rere.qmqm.pl>

--- linux-2.6.20/net/netfilter/nfnetlink_log.c.8	2007-02-11 23:59:01.000000000 +0100
+++ linux-2.6.20/net/netfilter/nfnetlink_log.c	2007-02-12 00:19:16.000000000 +0100
@@ -195,6 +195,10 @@ instance_create(u_int16_t group_num, int
 
 	write_unlock_bh(&instances_lock);
 
+	/* we want timestamps! we want to log those bastards! */
+	if (inst)
+		net_enable_timestamp();
+
 	return inst;
 }
 
@@ -230,6 +234,9 @@ _instance_destroy2(struct nfulnl_instanc
 
 	/* and finally put the refcount */
 	instance_put(inst);
+
+	/* we don't want timestamps anymore (decrement the counter) */
+	net_disable_timestamp();
 }
 
 static inline void



More information about the netfilter-devel mailing list