mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 11:01:19 +00:00
nwfilter: remove target table before renaming it
Remove the target table before renaming a table to it, i.e., remove table B before renaming A to B. This makes the renaming more robust against unconnected left-over tables.
This commit is contained in:
parent
efd6824cfc
commit
98c7d8b278
@ -125,12 +125,18 @@ static const char ebiptables_script_func_rm_chains[] =
|
|||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
static const char ebiptables_script_func_rename_chains[] =
|
static const char ebiptables_script_func_rename_chains[] =
|
||||||
|
"rename_chain()\n"
|
||||||
|
"{\n"
|
||||||
|
" $EBT -t nat -F $2\n"
|
||||||
|
" $EBT -t nat -X $2\n"
|
||||||
|
" $EBT -t nat -E $1 $2\n"
|
||||||
|
"}\n"
|
||||||
"rename_chains()\n"
|
"rename_chains()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" for tmp in $*; do\n"
|
" for tmp in $*; do\n"
|
||||||
" case $tmp in\n"
|
" case $tmp in\n"
|
||||||
" %c*) $EBT -t nat -E $tmp %c${tmp#?} ;;\n"
|
" %c*) rename_chain $tmp %c${tmp#?} ;;\n"
|
||||||
" %c*) $EBT -t nat -E $tmp %c${tmp#?} ;;\n"
|
" %c*) rename_chain $tmp %c${tmp#?} ;;\n"
|
||||||
" esac\n"
|
" esac\n"
|
||||||
" done\n"
|
" done\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user