Skip to content

Commit 46b20c3

Browse files
geliangtangummakynes
authored andcommitted
netfilter: use audit_log()
Use audit_log() instead of open-coding it. Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 166327d commit 46b20c3

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

net/bridge/netfilter/ebtables.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,15 +1069,10 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
10691069

10701070
#ifdef CONFIG_AUDIT
10711071
if (audit_enabled) {
1072-
struct audit_buffer *ab;
1073-
1074-
ab = audit_log_start(current->audit_context, GFP_KERNEL,
1075-
AUDIT_NETFILTER_CFG);
1076-
if (ab) {
1077-
audit_log_format(ab, "table=%s family=%u entries=%u",
1078-
repl->name, AF_BRIDGE, repl->nentries);
1079-
audit_log_end(ab);
1080-
}
1072+
audit_log(current->audit_context, GFP_KERNEL,
1073+
AUDIT_NETFILTER_CFG,
1074+
"table=%s family=%u entries=%u",
1075+
repl->name, AF_BRIDGE, repl->nentries);
10811076
}
10821077
#endif
10831078
return ret;

net/netfilter/x_tables.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,16 +1192,10 @@ xt_replace_table(struct xt_table *table,
11921192

11931193
#ifdef CONFIG_AUDIT
11941194
if (audit_enabled) {
1195-
struct audit_buffer *ab;
1196-
1197-
ab = audit_log_start(current->audit_context, GFP_KERNEL,
1198-
AUDIT_NETFILTER_CFG);
1199-
if (ab) {
1200-
audit_log_format(ab, "table=%s family=%u entries=%u",
1201-
table->name, table->af,
1202-
private->number);
1203-
audit_log_end(ab);
1204-
}
1195+
audit_log(current->audit_context, GFP_KERNEL,
1196+
AUDIT_NETFILTER_CFG,
1197+
"table=%s family=%u entries=%u",
1198+
table->name, table->af, private->number);
12051199
}
12061200
#endif
12071201

0 commit comments

Comments
 (0)