summaryrefslogtreecommitdiff
path: root/lib/Vyatta/IpTables/Rule.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/IpTables/Rule.pm')
-rw-r--r--lib/Vyatta/IpTables/Rule.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Vyatta/IpTables/Rule.pm b/lib/Vyatta/IpTables/Rule.pm
index a7f1ebb..ff645b2 100644
--- a/lib/Vyatta/IpTables/Rule.pm
+++ b/lib/Vyatta/IpTables/Rule.pm
@@ -53,6 +53,7 @@ my %fields = (
},
_disable => undef,
_ip_version => undef,
+ _comment => undef
);
my %dummy_rule = (
@@ -101,6 +102,7 @@ my %dummy_rule = (
},
_disable => undef,
_ip_version => undef,
+ _comment => undef
);
sub new {
@@ -125,6 +127,7 @@ sub setup {
my ( $self, $level ) = @_;
my $config = new Vyatta::Config;
+ $self->{_comment} = $level;
$config->setLevel("$level");
# for documentation sake. nodes returns an array so must transform
@@ -185,6 +188,7 @@ sub setupOrig {
my ( $self, $level ) = @_;
my $config = new Vyatta::Config;
+ $self->{_comment} = $level;
$config->setLevel("$level");
# for documentation sake. nodes returns an array so must transform
@@ -328,6 +332,10 @@ sub rule {
my $srcrule = $dstrule = undef;
my $err_str = undef;
+ # set CLI rule num as comment
+ my @level_nodes = split (' ', $self->{_comment});
+ $rule .= "-m comment --comment \"$level_nodes[2]-$level_nodes[4]\" ";
+
# set the protocol
if (defined($self->{_protocol})) {
my $str = $self->{_protocol};