mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-1135: [EC2 Query API] AuthorizeSecurityGroupIngress and RevokeSecurityGroupIngress fails when icmp code and type is provided
For AuthorizeSecurityGroupIngress RevokeSecurityGroupIngress query calls parse and set the icmp code and type
This commit is contained in:
parent
57969843d6
commit
c3be0f995d
@ -707,12 +707,20 @@ public class EC2RestServlet extends HttpServlet {
|
||||
else break;
|
||||
|
||||
String[] fromPort = request.getParameterValues( "IpPermissions." + nCount + ".FromPort" );
|
||||
if ( null != fromPort && 0 < fromPort.length)
|
||||
perm.setFromPort( Integer.parseInt( fromPort[0]));
|
||||
if ( null != fromPort && 0 < fromPort.length ) {
|
||||
if ( protocol[0].equalsIgnoreCase("icmp") )
|
||||
perm.setIcmpType( fromPort[0] ) ;
|
||||
else
|
||||
perm.setFromPort( Integer.parseInt( fromPort[0]) );
|
||||
}
|
||||
|
||||
String[] toPort = request.getParameterValues( "IpPermissions." + nCount + ".ToPort" );
|
||||
if ( null != toPort && 0 < toPort.length)
|
||||
perm.setToPort( Integer.parseInt( toPort[0]));
|
||||
if ( null != toPort && 0 < toPort.length ) {
|
||||
if ( protocol[0].equalsIgnoreCase("icmp") )
|
||||
perm.setIcmpCode( toPort[0] );
|
||||
else
|
||||
perm.setToPort( Integer.parseInt( toPort[0]) );
|
||||
}
|
||||
|
||||
// -> list: IpPermissions.n.IpRanges.m.CidrIp
|
||||
mCount = 1;
|
||||
@ -780,12 +788,20 @@ public class EC2RestServlet extends HttpServlet {
|
||||
else break;
|
||||
|
||||
String[] fromPort = request.getParameterValues( "IpPermissions." + nCount + ".FromPort" );
|
||||
if ( null != fromPort && 0 < fromPort.length)
|
||||
perm.setFromPort( Integer.parseInt( fromPort[0]));
|
||||
if ( null != fromPort && 0 < fromPort.length ) {
|
||||
if ( protocol[0].equalsIgnoreCase("icmp") )
|
||||
perm.setIcmpType( fromPort[0] ) ;
|
||||
else
|
||||
perm.setFromPort( Integer.parseInt( fromPort[0]) );
|
||||
}
|
||||
|
||||
String[] toPort = request.getParameterValues( "IpPermissions." + nCount + ".ToPort" );
|
||||
if ( null != toPort && 0 < toPort.length)
|
||||
perm.setToPort( Integer.parseInt( toPort[0]));
|
||||
if ( null != toPort && 0 < toPort.length ) {
|
||||
if ( protocol[0].equalsIgnoreCase("icmp") )
|
||||
perm.setIcmpCode( toPort[0] );
|
||||
else
|
||||
perm.setToPort( Integer.parseInt( toPort[0]) );
|
||||
}
|
||||
|
||||
// -> list: IpPermissions.n.IpRanges.m.CidrIp
|
||||
int mCount = 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user