-
Type: Bug
-
Status: Open (View Workflow)
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 1.12.0
-
Fix Version/s: None
-
Component/s: None
-
Labels:
-
Environment:
ONOS 1.12.0 release.
OS: ubuntu14.x
RAM: 16GB
-
Story Points:2
-
Epic Link:
Making MTU size for OSPF packets configurable instead of hardcoding of 1500. This will help to change the size of the MTU using rest. Attachment contains the complete file with fix to make MTU as configurable value. Please analyze the fix.
File Name: OspfConfigUtil.java
public static final String MTU = "mtu";
- Checks if valid mtu or not.
* - @param strInput input value
- @return true if valid else false
*/
private static boolean isValidMtu(String strInput) {
boolean isValid = true;
if (isPrimitive(strInput)) {
int input = Integer.parseInt(strInput);
if (input < 1 || input > 1500) {
log.debug("Wrong config input value: {}", strInput);
isValid = false;
} else { isValid = true; }
} else
{ isValid = false; } return isValid;
}
In function interfaceDetails
String mtu = interfaceNode.path(MTU).asText();
if (isValidMtu(mtu)) {
log.debug("MTU received is {} and setting the same.", mtu);
ospfInterface.setMtu(Integer.parseInt(mtu));
} else {
log.debug("Wrong MTU received: {}. So setting default MTU as 1024", mtu);
ospfInterface.setMtu(OspfUtil.MTU);
}
ospfInterface.setRouterPriority(OspfUtil.ROUTER_PRIORITY);
This fix is provided by Aricent.