[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15211480#comment-15211480
 ] 

ASF GitHub Bot commented on CLOUDSTACK-9317:
--------------------------------------------

Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1450#discussion_r57422486
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -778,10 +778,11 @@ public int compare(final PublicIpAddress o1, final 
PublicIpAddress o2) {
     
                     final boolean add = ipAddr.getState() == 
IpAddress.State.Releasing ? false : true;
                     boolean sourceNat = ipAddr.isSourceNat();
    -                /* enable sourceNAT for the first ip of the public 
interface */
    -                if (firstIP) {
    -                    sourceNat = true;
    +                /* enable sourceNAT for the first ip of the public 
interface as long as it's source nat. */
    +                if (firstIP && !sourceNat) {
    --- End diff --
    
    For additional public subnet case, sourceNat should be set to 'true' to add 
a source nat rule on VR for the first ip in that subnet. This changes will 
break that.
    
    If there is no source nat rule for the additional public subnet the traffic 
to this subnet from he VMs always go through the default source nat interface.


> Disabling static NAT on many IPs can leave wrong IPs on the router
> ------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-9317
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9317
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Management Server, Virtual Router
>    Affects Versions: 4.7.0, 4.7.1, 4.7.2
>            Reporter: Jeff Hair
>
> The current behavior of enabling or disabling static NAT will call the apply 
> IP associations method in the management server. The method is not 
> thread-safe. If it's called from multiple threads, each thread will load up 
> the list of public IPs in different states (add or revoke)--correct for the 
> thread, but not correct overall. Depending on execution order on the virtual 
> router, the router can end up with public IPs assigned to it that are not 
> supposed to be on it anymore. When another account acquires the same IP, this 
> of course leads to network problems.
> The problem has been in CS since at least 4.2, and likely affects all 
> recently released versions. Affected version is set to 4.7.x because that's 
> what we verified against.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to