diff mbox

netfilter: ebtables: use audit_log()

Message ID bcbd9b076cee1b585a756a1eadd16325dc341ca4.1502098910.git.geliangtang@gmail.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Geliang Tang Aug. 7, 2017, 1:44 p.m. UTC
Use audit_log() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/bridge/netfilter/ebtables.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

Pablo Neira Ayuso Aug. 19, 2017, 11:25 a.m. UTC | #1
On Mon, Aug 07, 2017 at 09:44:25PM +0800, Geliang Tang wrote:
> Use audit_log() instead of open-coding it.

Applied, thanks.

BTW, I have collapse your xtables change to this patch too.  part of
the same logical change. Hint: If you see yourself writing exactly the
same description for each patch you submit then it's likely to be fine
to merge them into one single patch. Just for the next time.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 9c6e619..54c7ef4 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -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;