You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% tools/validate_spec.py -s dhcp.rflx -m DHCP::Message -v tests/data/dhcp/message/validtests/data/dhcp/message/valid/DHCP_MessageType_10,11,12_and_13_4.raw: FAILEDFalseNegativepyrflx: error: cannot set value for field Htypepyrflx: error: Number 0 is not a valid enum valueTraceback (most recent call last): File "tools/validate_spec.py", line 334, in <module> sys.exit(cli(sys.argv)) File "tools/validate_spec.py", line 82, in cli validation_main(args) File "tools/validate_spec.py", line 135, in validation_main validation_result = validator.validate_message(msg) File "tools/validate_spec.py", line 200, in validate_message parser_result = self.__parse_message(original_message.bytes) File "tools/validate_spec.py", line 228, in __parse_message pdu_model.parse(message) File "[...]/lib/python3.7/site-packages/rflx/pyrflx/typevalue.py", line 736, in parse current_field_size = size.valueAttributeError: 'NoneType' object has no attribute 'value'
The used specification and test data can be found here.
The problem is that Message'Last in the field condition of Options cannot be resolved into a Number. If I change the type of the Options field to Opaque it can be parsed successfully (at least there is not the particular error you described).
One option that comes to mind to resolve this, is to treat an Array field similar to an Opaque field for this matter so that it is not needed to explicitly evaluate the size of the field if the Message variable is present in the size expression.
When setting an Array field where the size cannot be resolved, the set_field_without_size function would be used. Therefore it is needed to ensure that the field is accessible by using the _is_valid_opaque_field method (rename) to enable that, because normally a field without a size would not be accessible and thus could not be set.
The used specification and test data can be found here.
@rssen Could you please take a look at it?
The text was updated successfully, but these errors were encountered: