-
Type: Bug
-
Status: Closed (View Workflow)
-
Priority: Critical
-
Resolution: Done
-
Affects Version/s: 1.0.0, 1.0.1
-
Fix Version/s: 1.2.0
-
Component/s: None
-
Labels:None
-
Epic Link:
-
Sprint:Cardinal Sprint 4 (5/4-5/15)
We have the classical Java issue of storing and using
unsigned network-related values as signed values.
This issue becomes a bug when interfacing with the Loxi OpenFlow driver.
Within Criteria.java we keep match values like EthType (16-bits) and TCP port (16-bits) in Short (signed 16-bit values).
Those 16-bit signed values are then propagated to the Loxi OpenFlow driver which expects signed 32-bit integers:
public static TransportPort of(int port) {
if(port == NONE_VAL)
return NONE;
else if (port == NO_MASK.port)
return NO_MASK;
else if (port < MIN_PORT || port > MAX_PORT)
return new TransportPort(port);
}
As a result, if we try to use, say, TCP port number of (short) 0xfff0 that
will be expanded to (int) 0xfffffff0 and the above MIN_PORT/MAX_PORT
check will fail.
The same issue applies for other fields as well, and probably for some
of the values that are used to specify the OpeFlow-related actions.
- relates to
-
ONOS-2580 Introduce new data type or replace "short" to "int" for TCP/UDP port
- Closed