Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-960

Signed/unsigned value mismatch for OpenFlow-related match/action conditions

    XMLWordPrintable

    Details

    • 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)

      Description

      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)

      { throw new IllegalArgumentException("Illegal transport layer port nu\ mber: " + 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.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              ash ash
              Reporter:
              pavlin Pavlin Radoslavov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: