Closed Dronec closed 1 year ago
good point! I've oversimplifed it and only looked at the output of my local DHCP server. Should've read the RFC first. I'll update the code and make another push.
I've made some small changes, could you please check if it still works on your end?
I've made some small changes, could you please check if it still works on your end?
Pulled, recompiled and tested, looks good
Thanks!
Oops, actually I forgot to push the bulk of the changes I wanted to include... I pushed them to master.
https://github.com/CyberShadow/dhcptest/commit/19cd1e2fe13c779bce67dc7bbfe526a6d3d31f08
Thanks!
Thank you! This tool came very handy for testing DHCP design.
Oops, actually I forgot to push the bulk of the changes I wanted to include... I pushed them to master.
Hate to say that, but the refactoring broke it:
You can fix it by changing row #406 to
ubyte subnetSignificantBytes = cast(ubyte)ceil(maskBits * 0.125);
Hate to say that, but the refactoring broke it:
Well, thanks for saying it! I forgot the parens. 🤦
I pushed a fix, could you please test it?
Hate to say that, but the refactoring broke it:
Well, thanks for saying it! I forgot the parens. 🤦
I pushed a fix, could you please test it?
tested, everything looks good. Thanks!
Trying to use option=121 with the test request, and it's erroring out:
dhcptest --query --option 121
dhcptest v0.9 - Created by Vladimir Panteleev
https://github.com/CyberShadow/dhcptest
Run with --help for a list of command-line options.
Listening for DHCP replies on port 68.
Error with parsing option 121:
Fatal error: Sorry, the format classlessStaticRoute is unsupported for parsing. Please specify another format explicitly.
Curious what's I'm missing there.
For context I'm trying to reproduce this dhcp request:
dnsmasq-dhcp[9]: 445169678 vendor class: dhcpcd-8.1.6:Linux-4.9.77:armv7l:ecobee
dnsmasq-dhcp[9]: 445169678 client provides name: Thermostat
dnsmasq-dhcp[9]: 445169678 DHCPREQUEST(eth2) 10.1.30.105 44:61:32:b1:89:d9
dnsmasq-dhcp[9]: 445169678 tags: red, eth2
dnsmasq-dhcp[9]: 445169678 DHCPACK(eth2) 10.1.30.105 44:61:32:b1:89:d9 Thermostat
dnsmasq-dhcp[9]: 445169678 requested options: 1:netmask, 121:classless-static-route, 33:static-route,
dnsmasq-dhcp[9]: 445169678 requested options: 3:router, 6:dns-server, 12:hostname, 15:domain-name,
dnsmasq-dhcp[9]: 445169678 requested options: 26:mtu, 28:broadcast, 51:lease-time, 54:server-identifier,
dnsmasq-dhcp[9]: 445169678 requested options: 58:T1, 59:T2, 119:domain-search
Thank you.
I've read the RFC and it seems to describe something that doesn't align with the implementation here. For one thing, it looks like the route descriptors are variable-length.