mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-18 19:01:06 +02:00
ACL Input param validation for L4 port
Change-Id: I5862aab56404afaf4d36e982a0259a498fdab216
This commit is contained in:
parent
a77e3350b8
commit
cd125ded3b
@ -203,12 +203,20 @@ public class AclWebResource extends AbstractWebResource {
|
|||||||
|
|
||||||
int port = node.path("dstTpPort").asInt(0);
|
int port = node.path("dstTpPort").asInt(0);
|
||||||
if (port > 0) {
|
if (port > 0) {
|
||||||
rule.dstTpPort((short) port);
|
if ("TCP".equalsIgnoreCase(s) || "UDP".equalsIgnoreCase(s)) {
|
||||||
|
rule.dstTpPort((short) port);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("dstTpPort can be set only when ipProto is TCP or UDP");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
port = node.path("srcTpPort").asInt(0);
|
port = node.path("srcTpPort").asInt(0);
|
||||||
if (port > 0) {
|
if (port > 0) {
|
||||||
rule.srcTpPort((short) port);
|
if ("TCP".equalsIgnoreCase(s) || "UDP".equalsIgnoreCase(s)) {
|
||||||
|
rule.srcTpPort((short) port);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("srcTpPort can be set only when ipProto is TCP or UDP");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s = node.path("action").asText(null);
|
s = node.path("action").asText(null);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user