mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
bug 12917: security groups - icmp type/code validations.
This commit is contained in:
parent
d1dc819df5
commit
6aa0560d37
@ -1334,6 +1334,7 @@ def network_rules(session, args):
|
||||
if start == "-1":
|
||||
range = "any"
|
||||
iptables = ['iptables', '-I', vmchain, '-p', 'icmp', '--icmp-type', range, '-m', 'set', keyword, ipsetname, direction, '-j', action]
|
||||
|
||||
cmds.append(iptables)
|
||||
util.SMlog(iptables)
|
||||
|
||||
|
||||
@ -603,8 +603,8 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
|
||||
if (icmpType == -1 && icmpCode != -1) {
|
||||
throw new InvalidParameterValueException("Invalid icmp type range");
|
||||
}
|
||||
if (icmpCode > 255) {
|
||||
throw new InvalidParameterValueException("Invalid icmp code ");
|
||||
if (icmpCode > 255 || icmpType > 255 || icmpCode < -1 || icmpType < -1) {
|
||||
throw new InvalidParameterValueException("Invalid icmp type/code ");
|
||||
}
|
||||
startPortOrType = icmpType;
|
||||
endPortOrCode = icmpCode;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user