Skip to contentSkip to conversation

netfilter: xt_AUDIT: only generate audit log when audit enabled

PATCH Applied Gao feng 3 participants 3 messages Mar 4, 2013

Subsystems (2)
lore
Share & tools
lore

Gao feng

author
#0 lore raw

PATCH 1/1 netfilter: xt_AUDIT: only generate audit log when audit enabled

We should stop generting audit log if audit is disabled.

---
 net/netfilter/xt_AUDIT.c | 3 +++
 1 file changed, 3 insertions(+)
net/netfilter/xt_AUDIT.c +3 -0
index ba92824..3228d7f 100644
@@ -124,6 +124,9 @@ audit_tg(struct sk_buff *skb, const struct xt_action_param *par)
 	const struct xt_audit_info *info = par->targinfo;
 	struct audit_buffer *ab;
 
+	if (audit_enabled == 0)
+		goto errout;
+
 	ab = audit_log_start(NULL, GFP_ATOMIC, AUDIT_NETFILTER_PKT);
 	if (ab == NULL)
 		goto errout;
Signature · 1 line
1.7.11.7