Repository navigation
diam: keep only the P flag of the request in Answer - #276
Merged
Merged
Conversation
Answer cleared the R flag and copied every other request flag into the
answer. A request sent again after a failover has the T flag set, so
its answer went out with T set too, which RFC 6733 section 3 forbids
("This flag MUST NOT be set in answer messages"). The E flag and the
reserved bits of a malformed request were copied in the same way.
Set the answer flags to the P flag of the request, as section 6.2
says, and leave E for the caller to set on a protocol error answer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Message.Answerbuilt the answer flags asCommandFlags &^ RequestFlag, so it copied every request flag except R. RFC 6733 §3 says:§6.2 says the answer's P bit is set to the same value as in the request.
The answer flags are now
CommandFlags & ProxiableFlag. E is left to the caller for protocol-error answers. The existing sm tests, which check that an error CEA does not have E set, still pass. In-repo callers (CEA, DWA) don't depend on the old copying.Test:
diam/answer_flags_test.godecodes a retransmitted S6a AIR (flags0xd0) and checks several flag combinations. It fails on main (answer flags = 0x50, want 0x40).