Project

General

Profile

Actions

Bug #2791

closed

ControlParameters forwarding flags are decoded incorrectly

Added by Anonymous over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Start date:
05/06/2015
Due date:
% Done:

0%

Estimated time:

Description

In TestControlParametersEncodeDecode.testEncodeDecode I added the following test which fails:

assertEquals("decoded forwarding flags capture is different",
             controlParameters.getForwardingFlags().getCapture(),
      decodedControlParameters.getForwardingFlags().getCapture());

decodeControlParameters has:

ForwardingFlags flags = new ForwardingFlags();
flags.setNfdForwardingFlags((int) decoder.
  readOptionalNonNegativeIntegerTlv(Tlv.ControlParameters_Flags,
    endOffset));

But readOptionalNonNegativeIntegerTlv returns -1 if the forwarding flags are omitted, which means that all bits are 1 and setNfdForwardingFlags sets all the flags. Need to explicitly check if ControlParameters_Flags are present. (NDN-JS too)

Actions

Also available in: Atom PDF