Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
03b5e6a4
Commit
03b5e6a4
authored
Oct 25, 2010
by
Leigh B Stoller
Browse files
Wrap the other call to iptables in a loop, to deal with stupid
resource locking issue that iptables should deal with, not me!
parent
d2a1ee62
Changes
1
Show whitespace changes
Inline
Side-by-side
tmcd/linux/mkvnode.pl
View file @
03b5e6a4
...
...
@@ -395,8 +395,15 @@ if (exists($vnconfig{'SSHDPORT'}) && $vnconfig{'SSHDPORT'} ne "") {
my
$sshdport
=
$vnconfig
{'
SSHDPORT
'};
my
$ctrlip
=
$vnconfig
{'
CTRLIP
'};
# Retry a few times cause of iptables locking stupidity.
for
(
my
$i
=
0
;
$i
<
5
;
$i
++
)
{
system
("
$IPTABLES
-v -t nat -A PREROUTING -p tcp -d
$ext_ctrlip
"
.
"
--dport
$sshdport
-j DNAT --to-destination
$ctrlip
:
$sshdport
");
"
--dport
$sshdport
-j DNAT
"
.
"
--to-destination
$ctrlip
:
$sshdport
");
last
if
(
$?
==
0
);
sleep
(
2
);
}
}
#
...
...
@@ -546,7 +553,7 @@ sub Cleanup()
my
$ctrlip
=
$vnconfig
{'
CTRLIP
'};
# Retry a few times cause of iptables locking stupidity.
for
(
my
$i
=
0
;
$i
<
3
;
$i
++
)
{
for
(
my
$i
=
0
;
$i
<
5
;
$i
++
)
{
system
("
$IPTABLES
-v -t nat -D PREROUTING -p tcp -d
$ext_ctrlip
"
.
"
--dport
$sshdport
-j DNAT
"
.
"
--to-destination
$ctrlip
:
$sshdport
");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment