weizhouapache 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_r363295774
 
 

 ##########
 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:
   @wido the protocol is "icmp" in cloudstack, no matter the ip/cidr is ipv4 or 
ipv6.
   
   look at the code below
   
https://github.com/apache/cloudstack/pull/3736/files/c27fdfee8c9f5ab06cf18dd6dc41ba356d75f4c4#diff-d10df45583c471e8de4a64128f95c802R1066-R1070

----------------------------------------------------------------
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