Skip to contentSkip to conversation

netfilter 01/02: Make nflog quiet when no one listen in userspace.

PATCH Patrick McHardy 2 participants 2 messages Jun 11, 2008 – Jun 12, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Dave,

following are two fixes for netfilter:

- silence a noisy warning when no logging backend is active

- fix a ctnetlink related crash in nf_nat_setup_info()

The second one is a regression present since 2.6.23, I'll also send that one to -stable.

I have another patch queued to fix a NAT crash probably caused by a RCU race, but I'd like to get confirmation that it actually fixes the problem before sending it upstream, so I'll hold on to it for a few more days.

Please apply, thanks.

netfilter: Make nflog quiet when no one listen in userspace.

The message "nf_log_packet: can't log since no backend logging module loaded in! Please either load one, or disable logging explicitly" was displayed for each logged packet when no userspace application is listening to nflog events. The message seems to warn for a problem with a kernel module missing but as said before this is not the case. I thus propose to suppress the message (I don't see any reason to flood the log because a user application has crashed.)

---
commit 21fa91adce646ad0449e898a64edaa828ca131e7
tree 48ef8d9b33e312af5f55bf0d6795fab46c70fda2
parent 2e761e0532a784816e7e822dbaaece8c5d4be14d
author Eric Leblond <[email protected]> Tue, 10 Jun 2008 07:54:34 +0200 committer Patrick McHardy <[email protected]> Tue, 10 Jun 2008 07:54:34 +0200

 net/netfilter/nf_log.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
net/netfilter/nf_log.c +0 -4
index bc11d70..9fda6ee 100644
@@ -92,10 +92,6 @@ void nf_log_packet(int pf,
 		vsnprintf(prefix, sizeof(prefix), fmt, args);
 		va_end(args);
 		logger->logfn(pf, hooknum, skb, in, out, loginfo, prefix);
-	} else if (net_ratelimit()) {
-		printk(KERN_WARNING "nf_log_packet: can\'t log since "
-		       "no backend logging module loaded in! Please either "
-		       "load one, or disable logging explicitly\n");
 	}
 	rcu_read_unlock();
 }
maintainer
#1 lore raw

From: Patrick McHardy <[email protected]>
Date: Wed, 11 Jun 2008 14:42:04 +0200

Quoted 9 lines

following are two fixes for netfilter:

- silence a noisy warning when no logging backend is active

- fix a ctnetlink related crash in nf_nat_setup_info()

The second one is a regression present since 2.6.23, I'll also send that one to -stable.

Quoted 6 lines

I have another patch queued to fix a NAT crash probably caused by a RCU race, but I'd like to get confirmation that it actually fixes the problem before sending it upstream, so I'll hold on to it for a few more days.

Please apply, thanks.

Both fixes applied, thanks Patrick!