4141import org .apache .commons .net .util .SubnetUtils ;
4242import org .apache .log4j .Logger ;
4343
44- import com .cloud .utils .IteratorUtil ;
45- import com .cloud .utils .Pair ;
46- import com .cloud .utils .script .Script ;
4744import com .googlecode .ipv6 .IPv6Address ;
4845import com .googlecode .ipv6 .IPv6AddressRange ;
4946import com .googlecode .ipv6 .IPv6Network ;
5047
48+ import com .cloud .utils .IteratorUtil ;
49+ import com .cloud .utils .Pair ;
50+ import com .cloud .utils .script .Script ;
51+
5152public class NetUtils {
5253 protected final static Logger s_logger = Logger .getLogger (NetUtils .class );
5354 public final static String HTTP_PORT = "80" ;
@@ -832,7 +833,7 @@ public static supersetOrSubset isNetowrkASubsetOrSupersetOfNetworkB(String cidrA
832833 if (cidrALong [1 ] < cidrBLong [1 ]) {
833834 //this implies cidrA is super set of cidrB
834835 return supersetOrSubset .isSuperset ;
835- } else if (cidrALong [1 ] == cidrBLong [1 ]) {
836+ } else if (cidrALong [1 ]. equals ( cidrBLong [1 ]) ) {
836837 //this implies both the cidrs are equal
837838 return supersetOrSubset .sameSubnet ;
838839 }
@@ -1209,7 +1210,7 @@ public static boolean validateIcmpCode(long icmpCode) {
12091210
12101211 public static boolean isValidIpv6 (String ip ) {
12111212 try {
1212- IPv6Address address = IPv6Address .fromString (ip );
1213+ IPv6Address .fromString (ip );
12131214 } catch (IllegalArgumentException ex ) {
12141215 return false ;
12151216 }
@@ -1218,7 +1219,7 @@ public static boolean isValidIpv6(String ip) {
12181219
12191220 public static boolean isValidIp6Cidr (String ip6Cidr ) {
12201221 try {
1221- IPv6Network network = IPv6Network .fromString (ip6Cidr );
1222+ IPv6Network .fromString (ip6Cidr );
12221223 } catch (IllegalArgumentException ex ) {
12231224 return false ;
12241225 }
0 commit comments