+ try {
+ InetAddress address = InetAddress.getByName(ipaddress);
+ if ((isIpv6 && (address instanceof Inet4Address)) || (!isIpv6 && address instanceof Inet6Address)) {
+ LOG.debug("programPortSecurityRule: Remote vmIP {} does not match with SecurityRuleEthertype {}.", ipaddress, securityRuleEtherType);
+ return;
+ }
+ } catch (UnknownHostException e) {
+ LOG.warn("Invalid IP address {}", ipaddress);
+ return;
+ }