[PATCH] netfilter: xtables: use audit_log()

Subsystems: netfilter, networking [general], the rest

STALE3350d

2 messages, 2 authors, 2017-08-19 · open the first message on its own page

[PATCH] netfilter: xtables: use audit_log()

From: Geliang Tang <hidden>
Date: 2017-08-07 13:44:58

Use audit_log() instead of open-coding it.

Signed-off-by: Geliang Tang <redacted>
---
 net/netfilter/x_tables.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index e164823..c83a3b5 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1192,16 +1192,10 @@ xt_replace_table(struct xt_table *table,
 
 #ifdef CONFIG_AUDIT
 	if (audit_enabled) {
-		struct audit_buffer *ab;
-
-		ab = audit_log_start(current->audit_context, GFP_KERNEL,
-				     AUDIT_NETFILTER_CFG);
-		if (ab) {
-			audit_log_format(ab, "table=%s family=%u entries=%u",
-					 table->name, table->af,
-					 private->number);
-			audit_log_end(ab);
-		}
+		audit_log(current->audit_context, GFP_KERNEL,
+			  AUDIT_NETFILTER_CFG,
+			  "table=%s family=%u entries=%u",
+			  table->name, table->af, private->number);
 	}
 #endif
 
-- 
2.9.3

Re: [PATCH] netfilter: xtables: use audit_log()

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2017-08-19 11:26:06

On Mon, Aug 07, 2017 at 09:44:26PM +0800, Geliang Tang wrote:
Use audit_log() instead of open-coding it.
As said, collapsed into 'netfilter: ebtables: use audit_log()', just
for the record.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help