"nIP.getIpAddress().getBytes()" returns a byte representation of the
IP address string (including periods). What we really want is a byte
representation of the IP address represented by the string.
The solution is to use the InetAddress.getByName method that takes an
IP address string directly.
Change-Id: I39dcc1b8e97ab175e23d5aa2c9310581b87214ee
Signed-off-by: Andre Fredette <afredette@redhat.com>
for (Neutron_IPs nIP : gatewayPort.getFixedIPs()) {
InetAddress ipAddress;
try {
- ipAddress = InetAddress.getByAddress(nIP.getIpAddress().getBytes());
+ ipAddress = InetAddress.getByName(nIP.getIpAddress());
} catch (UnknownHostException e) {
LOG.warn("unknown host exception {}", e);
continue;