Skip to content

Commit

Permalink
Zero validation is added to fat flow protocal value.
Browse files Browse the repository at this point in the history
Zero value is allowed only to ICMP(Default Value)
TCP, UDP and SCTP  protocal's port value cannot have
a zero

Change-Id: I9b4bec60910b09f9a28a7f52280a6eb07a522056
Closes-Bug: #1523768
  • Loading branch information
balamurugang authored and vmahuli committed Jan 29, 2016
1 parent ac04b27 commit 9f25004
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions webroot/config/ports/ui/js/ports_config.js
Expand Up @@ -3023,18 +3023,20 @@ function validateFatFlow(element){
showInfoWindow("Select a protocol for Fat Flow Records", "Input required");
return false;
}
var fatFlow_prefix = $("#"+element +"_"+ elementid +"_txtPort").val();
if (typeof fatFlow_prefix === "undefined" || fatFlow_prefix.trim() === "") {
showInfoWindow("Enter valid port between 0 – 65535 for Fat Flow Record", "Input required");
return false;
}
if (!isNumber(fatFlow_prefix)) {
showInfoWindow("Fat Flow Protocol's Port has to be a number", "Input required");
return false;
}
if (Number(fatFlow_prefix) < 0 || Number(fatFlow_prefix) > 65535) {
showInfoWindow("Enter valid port between 0 – 65535 for Fat Flow Record", "Input required");
return false;
if(fatflowProtocol != "icmp") {
var fatFlow_prefix = $("#"+element +"_"+ elementid +"_txtPort").val();
if (typeof fatFlow_prefix === "undefined" || fatFlow_prefix.trim() === "") {
showInfoWindow("Enter valid port between 1 – 65535 for Fat Flow Record", "Input required");
return false;
}
if (!isNumber(fatFlow_prefix)) {
showInfoWindow("Fat Flow Protocol's Port has to be a number", "Input required");
return false;
}
if (Number(fatFlow_prefix) < 1 || Number(fatFlow_prefix) > 65535) {
showInfoWindow("Enter valid port between 1 – 65535 for Fat Flow Record", "Input required");
return false;
}
}
}
}
Expand Down

0 comments on commit 9f25004

Please sign in to comment.