wido commented on a change in pull request #3736: Add protocol number support 
for security group rules
URL: https://github.com/apache/cloudstack/pull/3736#discussion_r353095147
 
 

 ##########
 File path: scripts/vm/network/security_group.py
 ##########
 @@ -1032,7 +1032,18 @@ def add_network_rules(vm_name, vm_id, vm_ip, vm_ip6, 
signature, seqno, vmMac, ru
                 action = "ACCEPT"
                 direction = "-s"
 
-            range = str(start) + ':' + str(end)
+            if start == 0 and end == 0:
+                dport = ""
+            else:
+                dport = " --dport " + str(start) + ":" + str(end)
+
+            if protocol != 'all' and protocol != 'icmp' and protocol != 'tcp' 
and protocol != 'udp':
 
 Review comment:
   For ip6tables it's not 'icmp' which is used for the protocol, it's icmpv6, 
so don't we need to add a check there?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to