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

index 8bd8176b57fc98ac19714548bf694a58b65c578e..3faf4e876b1486a84700f5b2978b9f2adfe8a15c 100644 (file)
@@ -1496,7 +1496,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) {
                             LOG.warn("unknown host exception {}", e);
                             continue;