From: Andre Fredette Date: Tue, 8 Mar 2016 15:22:23 +0000 (-0500) Subject: Bug 5466 - GatewayMacResolver Broken X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=6f318a40cf4737f7aa851a2dadcef3e7a2103ca1;p=netvirt.git Bug 5466 - GatewayMacResolver Broken "nIP.getIpAddress().getBytes()" returns a byte representation of the literal IP address string. The current method needs 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: I99dd335d433125af1d7d5a0b88e377d6a1bfd62f Signed-off-by: Andre Fredette --- diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java index 0dc4483cfe..e988e20ee8 100644 --- a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java +++ b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java @@ -1405,7 +1405,7 @@ public class NeutronL3Adapter extends AbstractHandler implements GatewayMacResol for (Neutron_IPs nIP : gatewayPort.getFixedIPs()) { InetAddress ipAddress; try { - ipAddress = InetAddress.getByAddress(nIP.getIpAddress().getBytes()); + ipAddress = InetAddress.getByName(nIP.getIpAddress()); } catch (UnknownHostException e) { LOGGER.warn("unknown host exception {}", e); continue;