This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 137d6a8  CLOUDSTACK-10090: createPortForwardingRule api call accepts 
'halt' as Protocol which Stops VR (#2273)
137d6a8 is described below

commit 137d6a8940e03f0f0a67a78530bbe25650c17df5
Author: mrunalinikankariya <[email protected]>
AuthorDate: Wed Nov 8 10:25:37 2017 +0530

    CLOUDSTACK-10090: createPortForwardingRule api call accepts 'halt' as 
Protocol which Stops VR (#2273)
    
    …Protocol which Stops VR
    
    When we run the createPortForwardingRule API with input as Protocol as halt 
the PF rule is added however Halt is executed on VR. Hence the VR is stopped.
    
    Following entry added to Firewall_Rules table and VirtualRouter went to 
halt(stopped)
    mysql> select * from firewall_rules where id = 7
    
    *************************** 1. row ***************************
    id: 7
    uuid: XXXXXXXXXXXXXXXXXXXXXXXXXXX
    ip_address_id: 13
    start_port: 222
    end_port: 222
    state: Revoke
    protocol: halt
    purpose: PortForwarding
    account_id: 2
    domain_id: 1
    network_id: 208
    xid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    created: 2017-09-04 04:48:16
    icmp_code: NULL
    icmp_type: NULL
    related: NULL
    type: User
    vpc_id: NULL
    traffic_type
---
 server/src/com/cloud/network/element/VirtualRouterElement.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/src/com/cloud/network/element/VirtualRouterElement.java 
b/server/src/com/cloud/network/element/VirtualRouterElement.java
index 01bded0..9021999 100644
--- a/server/src/com/cloud/network/element/VirtualRouterElement.java
+++ b/server/src/com/cloud/network/element/VirtualRouterElement.java
@@ -23,6 +23,8 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.inject.Inject;
+
+import com.cloud.utils.net.NetUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import com.cloud.network.router.NetworkHelper;
@@ -568,7 +570,10 @@ NetworkMigrationResponder, AggregatedCommandExecutor, 
RedundantResource, DnsServ
         capabilities.put(Service.SourceNat, sourceNatCapabilities);
 
         capabilities.put(Service.StaticNat, null);
-        capabilities.put(Service.PortForwarding, null);
+
+        final Map<Capability, String> portForwardingCapabilities = new 
HashMap<Capability, String>();
+        portForwardingCapabilities.put(Capability.SupportedProtocols, 
NetUtils.TCP_PROTO + "," + NetUtils.UDP_PROTO);
+        capabilities.put(Service.PortForwarding, portForwardingCapabilities);
 
         return capabilities;
     }

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to