summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGaurav <gaurav.sinha@vyatta.com>2012-02-29 13:44:55 -0800
committerGaurav <gaurav.sinha@vyatta.com>2012-02-29 13:44:55 -0800
commit0e828626b8c8fcbfcbffe105ef61aca3b9818e0d (patch)
treed2271205145d873933cfe36217b4fc381e925995 /lib
parent2ddf45aff7672525f66bbf2e642b85cbca25b0a3 (diff)
downloadvyatta-cfg-firewall-0e828626b8c8fcbfcbffe105ef61aca3b9818e0d.tar.gz
vyatta-cfg-firewall-0e828626b8c8fcbfcbffe105ef61aca3b9818e0d.zip
fixing 7047
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/IpTables/Rule.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Vyatta/IpTables/Rule.pm b/lib/Vyatta/IpTables/Rule.pm
index d3c11e0..72bd536 100755
--- a/lib/Vyatta/IpTables/Rule.pm
+++ b/lib/Vyatta/IpTables/Rule.pm
@@ -300,8 +300,12 @@ sub get_log_prefix {
# want to include "[$chain-$rule_num-$action] " but that would require
# 1 29 1 4 1 1 11 = 39
# so truncate the chain name so that it'll all fit.
- $chain = substr($chain, 0, 19) if length($chain) > 19;
my $action_char = uc(substr($action, 0, 1));
+ if ( length($chain) > 19 ) {
+ $chain = substr($chain, 0, 19);
+ printf STDERR 'Firewall config warning: '
+ . "rule $rule_num logging prefix will be truncated to [$chain-$rule_num-$action_char]\n";
+ }
my $log_prefix = "[$chain-$rule_num-$action_char] ";
return $log_prefix;
}