You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-firewall/ebtables/files/ebtables-2.0.8.1-ebt-save.diff

32 lines
1.1 KiB

--- ./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);