Skip to content

Commit ed018fa

Browse files
Gao fengummakynes
authored andcommitted
netfilter: xt_AUDIT: only generate audit log when audit enabled
We should stop generting audit log if audit is disabled. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent f9caed5 commit ed018fa

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/netfilter/xt_AUDIT.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ audit_tg(struct sk_buff *skb, const struct xt_action_param *par)
124124
const struct xt_audit_info *info = par->targinfo;
125125
struct audit_buffer *ab;
126126

127+
if (audit_enabled == 0)
128+
goto errout;
129+
127130
ab = audit_log_start(NULL, GFP_ATOMIC, AUDIT_NETFILTER_PKT);
128131
if (ab == NULL)
129132
goto errout;

0 commit comments

Comments
 (0)