Skip to content

Commit 2837fc6

Browse files
committed
delete rule before adding again
1 parent 76aff0f commit 2837fc6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,13 @@ public synchronized String allowOutgoingOnPrivate(String destCidr) {
22902290
Script command = new Script("/bin/bash", s_logger);
22912291
String intf = "eth1";
22922292
command.add("-c");
2293+
command.add("iptables -D OUTPUT -o " + intf + " -d " + destCidr + " -p tcp -m state --state NEW -m tcp -j ACCEPT");
2294+
2295+
/* ignore the String result =*/ command.execute();
2296+
2297+
command = new Script("/bin/bash", s_logger);
2298+
String intf = "eth1";
2299+
command.add("-c");
22932300
command.add("iptables -I OUTPUT -o " + intf + " -d " + destCidr + " -p tcp -m state --state NEW -m tcp -j ACCEPT");
22942301

22952302
String result = command.execute();
@@ -2834,6 +2841,10 @@ private void startAdditionalServices() {
28342841
}
28352842
command = new Script("/bin/bash", s_logger);
28362843
command.add("-c");
2844+
command.add("iptables -D INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 3922 -j ACCEPT");
2845+
/* ignore result = */ command.execute();
2846+
command = new Script("/bin/bash", s_logger);
2847+
command.add("-c");
28372848
command.add("iptables -I INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 3922 -j ACCEPT");
28382849
result = command.execute();
28392850
if (result != null) {

0 commit comments

Comments
 (0)