Contents of /trunk/ebtables/patches/ebtables-2.0.8.2-ebt-save.patch
Parent Directory
|
Revision Log
Revision 431 -
(show annotations)
(download)
Fri Dec 14 10:49:50 2007 UTC (16 years, 5 months ago) by niro
File size: 1089 byte(s)
Fri Dec 14 10:49:50 2007 UTC (16 years, 5 months ago) by niro
File size: 1089 byte(s)
-save tables names as parameter
1 | --- ./ebtables-save.orig 2007-09-28 22:50:35.000000000 +0400 |
2 | +++ ./ebtables-save 2007-09-28 22:51:22.000000000 +0400 |
3 | @@ -12,6 +12,7 @@ |
4 | my $cnt = ""; |
5 | my $version = "1.0"; |
6 | my $table_name; |
7 | +my @table_names; |
8 | |
9 | # ======================================================== |
10 | # Process filter table |
11 | @@ -49,12 +50,19 @@ |
12 | } |
13 | # ======================================================== |
14 | |
15 | +if ($#ARGV + 1 == 0) { |
16 | + @table_names =split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`); |
17 | +} |
18 | +else { |
19 | + @table_names = @ARGV; |
20 | +} |
21 | +# ======================================================== |
22 | unless (-x $ebtables) { exit -1 }; |
23 | print "# Generated by ebtables-save v$version on " . `date`; |
24 | if (defined($ENV{'EBTABLES_SAVE_COUNTER'}) && $ENV{'EBTABLES_SAVE_COUNTER'} eq "yes") { |
25 | $cnt = "--Lc"; |
26 | } |
27 | -foreach $table_name (split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`)) { |
28 | +foreach $table_name (@table_names) { |
29 | $table =`$ebtables -t $table_name -L $cnt`; |
30 | unless ($? == 0) { print $table; exit -1 }; |
31 | &process_table($table); |