jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds-labs] CloudSigma2 ComputeService and SecurityGroupExtension (#70)
Date Sun, 05 Oct 2014 14:12:01 GMT
> +                  destinationPort.length());
> +         }
> +         if (destinationPort.contains(":")) {
> +            int[] ports = parsePort(destinationPort);
> +            permissionBuilder.fromPort(ports[0]);
> +            permissionBuilder.toPort(ports[1]);
> +         } else {
> +            int port = Integer.parseInt(destinationPort);
> +            permissionBuilder.fromPort(port);
> +            permissionBuilder.toPort(port);
> +         }
> +      }
> +      permissionBuilder.ipProtocol(input.getIpProtocol() != null ? firewallIpProtocolToIpProtocol.get(input
> +            .getIpProtocol()) : IpProtocol.UNRECOGNIZED);
> +      if (input.getSourceIp() != null) {
> +         permissionBuilder.cidrBlock(input.getSourceIp().contains("!") ? "0.0.0.0/0"
: input.getSourceIp());

Same as commented above. The `!` operator negates a range, and returning `0.0.0.0\0` would
also include the IPs that should be out of the rule. This must be changed, together with the
port parsing, to return a rule (or a set of rules) that properly matches what is defined in
the given `FirewallRule`.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/70/files#r18435403
Mime
View raw message