Actions
Bug #2791
closedControlParameters forwarding flags are decoded incorrectly
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)
Updated by Anonymous over 9 years ago
- Status changed from New to Closed
Added the explicit check in decodeControlParameters. Added the unit test. (also in NDN-JS):
https://github.com/named-data/jndn/commit/df1b01a16f160cef66822d7483ba8c101ce7c2bb#diff-f1c681d1d81fd7ca079c24b5765dfdad
https://github.com/named-data/ndn-js/commit/87a094f27c650b2affbdcd7f94427a28b8fffeac#diff-9ad851659cdb3c30fd3fd153ab177d18
Actions