mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	SG: Apply rules for both ipv4/ipv6 of VMs with associated account/SG (#11243)
This commit is contained in:
		
							parent
							
								
									05e7a257ca
								
							
						
					
					
						commit
						ba7ec88650
					
				| @ -50,6 +50,9 @@ public class SecurityGroupVMMapVO implements InternalIdentity { | |||||||
|     @Column(name = "ip4_address", table = "nics", insertable = false, updatable = false) |     @Column(name = "ip4_address", table = "nics", insertable = false, updatable = false) | ||||||
|     private String guestIpAddress; |     private String guestIpAddress; | ||||||
| 
 | 
 | ||||||
|  |     @Column(name = "ip6_address", table = "nics", insertable = false, updatable = false) | ||||||
|  |     private String guestIpv6Address; | ||||||
|  | 
 | ||||||
|     @Column(name = "state", table = "vm_instance", insertable = false, updatable = false) |     @Column(name = "state", table = "vm_instance", insertable = false, updatable = false) | ||||||
|     private State vmState; |     private State vmState; | ||||||
| 
 | 
 | ||||||
| @ -77,6 +80,10 @@ public class SecurityGroupVMMapVO implements InternalIdentity { | |||||||
|         return guestIpAddress; |         return guestIpAddress; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public String getGuestIpv6Address() { | ||||||
|  |         return guestIpv6Address; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public long getInstanceId() { |     public long getInstanceId() { | ||||||
|         return instanceId; |         return instanceId; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -354,6 +354,9 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro | |||||||
|                             String cidr = defaultNic.getIPv4Address(); |                             String cidr = defaultNic.getIPv4Address(); | ||||||
|                             cidr = cidr + "/32"; |                             cidr = cidr + "/32"; | ||||||
|                             cidrs.add(cidr); |                             cidrs.add(cidr); | ||||||
|  |                             if (defaultNic.getIPv6Address() != null) { | ||||||
|  |                                 cidrs.add(defaultNic.getIPv6Address() + "/64"); | ||||||
|  |                             } | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 } else if (rule.getAllowedSourceIpCidr() != null) { |                 } else if (rule.getAllowedSourceIpCidr() != null) { | ||||||
|  | |||||||
| @ -250,6 +250,9 @@ public class SecurityGroupManagerImpl2 extends SecurityGroupManagerImpl { | |||||||
|                         //did a join with the nics table |                         //did a join with the nics table | ||||||
|                         String cidr = ngmapVO.getGuestIpAddress() + "/32"; |                         String cidr = ngmapVO.getGuestIpAddress() + "/32"; | ||||||
|                         cidrs.add(cidr); |                         cidrs.add(cidr); | ||||||
|  |                         if (ngmapVO.getGuestIpv6Address() != null) { | ||||||
|  |                             cidrs.add(ngmapVO.getGuestIpv6Address() + "/64"); | ||||||
|  |                         } | ||||||
|                     } |                     } | ||||||
|                 } else if (rule.getAllowedSourceIpCidr() != null) { |                 } else if (rule.getAllowedSourceIpCidr() != null) { | ||||||
|                     cidrs.add(rule.getAllowedSourceIpCidr()); |                     cidrs.add(rule.getAllowedSourceIpCidr()); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user