netfilter: use audit_log()
authorGeliang Tang <geliangtang@gmail.com>
Mon, 7 Aug 2017 13:44:25 +0000 (21:44 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 19 Aug 2017 11:09:31 +0000 (13:09 +0200)
Use audit_log() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/bridge/netfilter/ebtables.c
net/netfilter/x_tables.c

index 9c6e619f452bc96770a8e340d3879adce6dadd2a..54c7ef4e970e1434cee92cd4ec0b572e94b327ef 100644 (file)
@@ -1069,15 +1069,10 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
 
 #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",
-                                        repl->name, AF_BRIDGE, repl->nentries);
-                       audit_log_end(ab);
-               }
+               audit_log(current->audit_context, GFP_KERNEL,
+                         AUDIT_NETFILTER_CFG,
+                         "table=%s family=%u entries=%u",
+                         repl->name, AF_BRIDGE, repl->nentries);
        }
 #endif
        return ret;
index e1648238a9c99d234d77ab1711d18db9d49926bd..c83a3b5e1c6c2a91b713b6681a794bd79ab3fa08 100644 (file)
@@ -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