-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DHCP option order not being preserved #76
base: master
Are you sure you want to change the base?
Conversation
Just to be clear, removing the manual insert of fyi, the v6 options use an array because it's possible to have multiple options with the same opt code. The items are stored sorted based on the underlying I'm not sure I want to preserve the insertion order unless there's a really good reason. If we're going to break backwards compatibility, I'm leaning towards the btree I think. |
Sorry for the delay on this. I'm unsure why this would break backwards compatibility. It's giving 100% test passing on my machine, it looked like last time was a serde issue, so hopefully by explicitly enabling the Also imo I think that a protocol encoding library should be byte-by-byte accurate across executions. |
On Wed, Oct 09, 2024 at 09:58:54PM -0700, f3rn0s wrote:
Also imo I think that a protocol encoding library
should be byte-by-byte accurate between runs.
I think that it is good thing if server replies to options in the same
order as original requested by the client. ( In other words: Do not
assume that both ends can deal with a reshuffled option order. )
Groeten
Geert Stappers
--
Silence is hard to parse
|
@f3rn0s the iterator type makes it into the public API in Have either of you seen anything in RFC's which implied an option order? I lean more towards btreemap because it's in the standard lib, requires no dependencies, and satisfies your concern of producing the same byte-by-byte output. |
Pull Request Test Coverage Report for Build 11267679355Details
💛 - Coveralls |
@leshow I opted for IndexMap since that preserves insertion order over just a consistent, but not necessarily visible/modifiable, order. There was no reference to ordering in RFC 2131 or 2132, but it would be nice to have granular control in case we came across a server or client implementation that has weird requirements. |
Fixes #75 by introducing a data-structure that will preserve insertion order.