Added support for IPv6 addresses to class IpAddress:
- For some of the methods, the IP Version needs to be specified by the
caller. This applies to the IpPrefix API as well.
- For now, everywhere IpAddress is used and the IP version has to be
explicitly specified by the caller, we assume/specify IPv4.
- Added unit test for class IpAddress: for both IPv4 and IPv6 addresses.
diff --git a/apps/sdnip/src/main/java/org/onlab/onos/sdnip/bgp/BgpSession.java b/apps/sdnip/src/main/java/org/onlab/onos/sdnip/bgp/BgpSession.java
index af67f1a..901ac90 100644
--- a/apps/sdnip/src/main/java/org/onlab/onos/sdnip/bgp/BgpSession.java
+++ b/apps/sdnip/src/main/java/org/onlab/onos/sdnip/bgp/BgpSession.java
@@ -246,11 +246,13 @@
InetAddress inetAddr;
if (localAddress instanceof InetSocketAddress) {
inetAddr = ((InetSocketAddress) localAddress).getAddress();
- localIp4Address = IpAddress.valueOf(inetAddr.getAddress());
+ localIp4Address = IpAddress.valueOf(IpAddress.Version.INET,
+ inetAddr.getAddress());
}
if (remoteAddress instanceof InetSocketAddress) {
inetAddr = ((InetSocketAddress) remoteAddress).getAddress();
- remoteIp4Address = IpAddress.valueOf(inetAddr.getAddress());
+ remoteIp4Address = IpAddress.valueOf(IpAddress.Version.INET,
+ inetAddr.getAddress());
}
log.debug("BGP Session Connected from {} on {}",