Bug 5466 - GatewayMacResolver Broken
authorAndre Fredette <afredette@redhat.com>
Tue, 8 Mar 2016 15:22:23 +0000 (10:22 -0500)
committerAndre Fredette <afredette@redhat.com>
Tue, 8 Mar 2016 15:22:23 +0000 (10:22 -0500)
"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 <afredette@redhat.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java

index 0dc4483cfe9b1409ce098e4d222cb037a4d5cd93..e988e20ee8eeb2d380fbcefd784b51d0e0574765 100644 (file)
@@ -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;