Skip to content

Commit

Permalink
netfilter: ebtables: create audit records for replaces
Browse files Browse the repository at this point in the history
This is already done for x_tables (family AF_INET and AF_INET6), let's
do it for AF_BRIDGE also.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Nicolas Dichtel authored and Pablo Neira Ayuso committed Sep 9, 2014
1 parent e42eff8 commit c55fbbb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions net/bridge/netfilter/ebtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <asm/uaccess.h>
#include <linux/smp.h>
#include <linux/cpumask.h>
#include <linux/audit.h>
#include <net/sock.h>
/* needed for logical [in,out]-dev filtering */
#include "../br_private.h"
Expand Down Expand Up @@ -1058,6 +1059,20 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
vfree(table);

vfree(counterstmp);

#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);
}
}
#endif
return ret;

free_unlock:
Expand Down

0 comments on commit c55fbbb

Please sign in to comment.