Skip to content

Commit 1bc44a5

Browse files
author
Sheng Yang
committed
bug 12705: Don't set first ip if it's not source NAT
It would happen with first ip of nics other than first public nic. status 12705: resolved fixed
1 parent d56d1f6 commit 1bc44a5

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,8 @@ protected void assignPublicIpAddress(Connection conn, String vmName, String priv
15831583
if (add && correctVif == null) {
15841584
addVif = true;
15851585
} else if (!add && firstIP) {
1586+
/* FIXME: This is incorrect. Because you can only tell if it's the first IP in this bundle of ip address which send to the router,
1587+
* but don't know if it's the only IP left in the router - because we didn't send all the related vlan's IPs to the router now. */
15861588
removeVif = true;
15871589
}
15881590

‎server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,6 +2443,10 @@ public int compare(PublicIpAddress o1, PublicIpAddress o2) {
24432443
IpAddressTO[] ipsToSend = new IpAddressTO[ipAddrList.size()];
24442444
int i = 0;
24452445
boolean firstIP = true;
2446+
/* If the first IP is not source NAT, then don't treat it as first IP. It would happen if it's the first IP for public nic other than first one */
2447+
if (!ipAddrList.get(0).isSourceNat()) {
2448+
firstIP = false;
2449+
}
24462450
for (final PublicIpAddress ipAddr : ipAddrList) {
24472451

24482452
boolean add = (ipAddr.getState() == IpAddress.State.Releasing ? false : true);

0 commit comments

Comments
 (0)