Skip to content

Commit e31cd2b

Browse files
committed
CLOUDSTACK-1402: listRouters API response doesn't return linklocal IP and public IP details.
1 parent aa40c7e commit e31cd2b

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,29 @@ public DomainRouterResponse newDomainRouterResponse(DomainRouterJoinVO router, A
170170
public DomainRouterResponse setDomainRouterResponse(DomainRouterResponse vrData, DomainRouterJoinVO vr) {
171171
long nic_id = vr.getNicId();
172172
if (nic_id > 0) {
173+
TrafficType ty = vr.getTrafficType();
174+
if (ty != null) {
175+
// legacy code, public/control/guest nic info is kept in
176+
// nics response object
177+
if (ty == TrafficType.Public) {
178+
vrData.setPublicIp(vr.getIpAddress());
179+
vrData.setPublicMacAddress(vr.getMacAddress());
180+
vrData.setPublicNetmask(vr.getNetmask());
181+
vrData.setGateway(vr.getGateway());
182+
vrData.setPublicNetworkId(vr.getNetworkUuid());
183+
} else if (ty == TrafficType.Control) {
184+
vrData.setLinkLocalIp(vr.getIpAddress());
185+
vrData.setLinkLocalMacAddress(vr.getMacAddress());
186+
vrData.setLinkLocalNetmask(vr.getNetmask());
187+
vrData.setLinkLocalNetworkId(vr.getNetworkUuid());
188+
} else if (ty == TrafficType.Guest) {
189+
vrData.setGuestIpAddress(vr.getIpAddress());
190+
vrData.setGuestMacAddress(vr.getMacAddress());
191+
vrData.setGuestNetmask(vr.getNetmask());
192+
vrData.setGuestNetworkId(vr.getNetworkUuid());
193+
vrData.setNetworkDomain(vr.getNetworkDomain());
194+
}
195+
}
173196
NicResponse nicResponse = new NicResponse();
174197
nicResponse.setId(vr.getNicUuid());
175198
nicResponse.setIpaddress(vr.getIpAddress());

0 commit comments

Comments
 (0)