blob: cdfd823447ed9aaecd25d792e8458d7ed027a96c [file] [log] [blame]
--- ./ebtables-save.orig 2007-09-28 22:50:35.000000000 +0400
+++ ./ebtables-save 2007-09-28 22:51:22.000000000 +0400
@@ -12,6 +12,7 @@
my $cnt = "";
my $version = "1.0";
my $table_name;
+my @table_names;
# ========================================================
# Process filter table
@@ -49,12 +50,19 @@
}
# ========================================================
+if ($#ARGV + 1 == 0) {
+ @table_names =split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`);
+}
+else {
+ @table_names = @ARGV;
+}
+# ========================================================
unless (-x $ebtables) { exit -1 };
print "# Generated by ebtables-save v$version on " . `date`;
if (defined($ENV{'EBTABLES_SAVE_COUNTER'}) && $ENV{'EBTABLES_SAVE_COUNTER'} eq "yes") {
$cnt = "--Lc";
}
-foreach $table_name (split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`)) {
+foreach $table_name (@table_names) {
$table =`$ebtables -t $table_name -L $cnt`;
unless ($? == 0) { print $table; exit -1 };
&process_table($table);