diff options
author | Joe Perches <joe@perches.com> | 2012-09-11 22:04:53 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-09-12 11:17:35 -0400 |
commit | 16af511a666827eaf5802144f09e2fb7b0942c99 (patch) | |
tree | f1da89fc4df016932838ba591d24c504647831f1 /net | |
parent | 4a70bbfaef0361d27272629d1a250a937edcafe4 (diff) |
netfilter: log: Fix log-level processing
auto75914331@hushmail.com reports that iptables does not correctly
output the KERN_<level>.
$IPTABLES -A RULE_0_in -j LOG --log-level notice --log-prefix "DENY in: "
result with linux 3.6-rc5
Sep 12 06:37:29 xxxxx kernel: <5>DENY in: IN=eth0 OUT= MAC=.......
result with linux 3.5.3 and older:
Sep 9 10:43:01 xxxxx kernel: DENY in: IN=eth0 OUT= MAC......
commit 04d2c8c83d0
("printk: convert the format for KERN_<LEVEL> to a 2 byte pattern")
updated the syslog header style but did not update netfilter uses.
Do so.
Use KERN_SOH and string concatenation instead of "%c" KERN_SOH_ASCII
as suggested by Eric Dumazet.
Signed-off-by: Joe Perches <joe@perches.com>
cc: auto75914331@hushmail.com
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/netfilter/ebt_log.c | 2 | ||||
-rw-r--r-- | net/netfilter/xt_LOG.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index f88ee537fb2b..92de5e5f9db2 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c | |||
@@ -80,7 +80,7 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum, | |||
80 | unsigned int bitmask; | 80 | unsigned int bitmask; |
81 | 81 | ||
82 | spin_lock_bh(&ebt_log_lock); | 82 | spin_lock_bh(&ebt_log_lock); |
83 | printk("<%c>%s IN=%s OUT=%s MAC source = %pM MAC dest = %pM proto = 0x%04x", | 83 | printk(KERN_SOH "%c%s IN=%s OUT=%s MAC source = %pM MAC dest = %pM proto = 0x%04x", |
84 | '0' + loginfo->u.log.level, prefix, | 84 | '0' + loginfo->u.log.level, prefix, |
85 | in ? in->name : "", out ? out->name : "", | 85 | in ? in->name : "", out ? out->name : "", |
86 | eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, | 86 | eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, |
diff --git a/net/netfilter/xt_LOG.c b/net/netfilter/xt_LOG.c index 2a4f9693e799..91e9af4d1f42 100644 --- a/net/netfilter/xt_LOG.c +++ b/net/netfilter/xt_LOG.c | |||
@@ -443,8 +443,8 @@ log_packet_common(struct sbuff *m, | |||
443 | const struct nf_loginfo *loginfo, | 443 | const struct nf_loginfo *loginfo, |
444 | const char *prefix) | 444 | const char *prefix) |
445 | { | 445 | { |
446 | sb_add(m, "<%d>%sIN=%s OUT=%s ", loginfo->u.log.level, | 446 | sb_add(m, KERN_SOH "%c%sIN=%s OUT=%s ", |
447 | prefix, | 447 | '0' + loginfo->u.log.level, prefix, |
448 | in ? in->name : "", | 448 | in ? in->name : "", |
449 | out ? out->name : ""); | 449 | out ? out->name : ""); |
450 | #ifdef CONFIG_BRIDGE_NETFILTER | 450 | #ifdef CONFIG_BRIDGE_NETFILTER |