-
Notifications
You must be signed in to change notification settings - Fork 0
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
Parse --dhcp-host #24
Conversation
I added a number of tests. There are two tests that are commented out with a TODO. Namely one featuring wildcards in mac addresses, and another one with an ipv6 address. I think the latter should be easy to implement, but if that is only applicable for DHCPv6, which I don't think we have an implementation for, it's maybe not worth implementing. |
f4cb8ec
to
7989571
Compare
7989571
to
3276df0
Compare
looks fine to me, should there be a test using the |
The "net:" thing is deprecated and the documentation only uses "set:".
I pushed a commit that changes some internal naming. The |
We should allow non-decimal hex characters in the first byte of a mac address. This also changes one of the tests to trigger this bug.
The set: field assigns a tag while tag: matches with a previously assigned tag.
Co-authored-by: Hannes Mehnert <[email protected]>
The net: syntax is a backwards compatible form of set:
Co-authored-by: Hannes Mehnert <[email protected]>
Dnsmasq will silently ignore duplicate values for some of the dhcp-host arguments. We will error out and inform the user of this.
I think the parser is more or less there. I plan on adding tests.
I still don't quite understand how all the values are to be used. We may want to error out on certain values and combinations. Part of the values are for matching a client, some are values to assign to the client. Then we have the
ignore
flag which means we should not handle a client matching - in that case the values to assign have questionable meaning.Dnsmasq uses a function
parse_hex()
for parsing mac addresses but alsoid:
s if there are any colons in the id value. The function is really obscure, and allows you to write an idid:41------424344:*:*:*:*
that, likely due to a safety bug, is the same asid:ABCD----
. There's a lot of nonsense in there that I don't think we should support.Mac address parsing could as well be improved. In particular there's no wildcards yet (you can write a mac address "pattern"
00:11:*:*:44:55
where the middle two bytes match any value).