-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Add DHCP client options 43 and 60 (IDFGH-4998) #6786
Comments
Thanks for raising this feature request. |
Hi @Alvin1Zhang, Is there an ETA for implementation of this request? Thanks! |
@RadekHvizdos Thanks for reporting and sorry for replying late, we are still evaluating this feature, will get back to you once we have any progress. Thanks. |
@RadekHvizdos |
Hi @lhespress, Thank you for the patch. I have deployed it on the latest master build:
Thank you for your support! |
@RadekHvizdos 43 option is sent from server to client. we can add a handle of receiving option, but I think it shouldn't add discover and request array. |
@RadekHvizdos Please replace the attachment which modify |
Hi @lhespress, I can confirm that items 1, 2 and 3 are now working as expected. With regards to receiving VSI. This works, but you have to add
DHCP log when DHCP_OPTION_VSI is not requested (patch #2 default):
DHCP log when DHCP_OPTION_VSI is requested:
Notice that the VSI is transmitted as a byte array. My dnsmasq DNS server is confirgured: And printed in the console as: It starts with a vendor specified number (1-254) and always ends with 0xff. Thanks! |
Could you explain it which on RFC2132? in my option, it's ignore by DHCP Server. 8.4. Vendor Specific Information This option is used by clients and servers to exchange vendor- |
Hi @lhespress, We have to let the DHCP server know that we want the VSI by requesting this option. The server will not send it just because we have indicated the proper VCI (class name). The highlighted text only talks about ignoring this option if it is not supported. My testing under dnsmasq supports this. Perhaps we could get someone to test this under different DHCP server? Thanks! |
@RadekHvizdos Great, If there are multiple DHCP server support that, we can add it. |
Hi @lhespress, I have installed Windows Server 2022, and enabled its DHCP server to test its behavior. I was surprised to see it provided the VSI even without our client explicitly requesting the option. So I have looked at the source code of my Linux DHCP server (dnsmasq) and found it's behavior is intentionally different, but can be overridden to work like Windows DHCP does.
This works: I still think it would be more proper to explicitly request this option, but I understand your hesitation with introducing this change. Perhaps we could hide it behind #if macros ? Thanks! |
I add the DHCP_OPTION_VSI to dhcp_discover_request_options array, but you can see the attachment, add the option to DHCP Discover & DHCP Request message or not, The DHCP Server response the specific information. , you can pick it out by MAC address: 7c:df:a1:76:41:5c
|
Hi @lhespress, Thank you for implementing a configurable DHCP_OPTION_VSI option in the Parameter Request List. I have confirmed both use cases look correct, thanks for the packet captures. One last thing that we have missed is this incorrect label, can you please rename it to LWIP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER ?
What are the next steps? How can I support this effort moving forward to mainline? I would love to have this present in 4.4 if possible. Thanks! |
Thanks for your feedback, I have created an internal merge request, it's reviewing now. I'll update it to you once merged. |
Hello @lhespress Are there any updates regarding this? Thanks! |
@RadekHvizdos It's reviewing now and it'll take a long time because of this is a modification of |
* Cherry-pick important fixes to 2.1.2-esp - CVE-2020-22283: Attacker could craft a packet that would disclose 8 bytes of some heap memory: - icmp6: Don't copy too much data - icmp6: Fix copying of chained pbuf in reply - icmp6: keep to the RFC and send as much as possible with icmp6 error messages - CVE-2020-22284: ZEP - ZigBee Encapsulation Protocol/6LoWPAN is not supported in IDF, the netif module (zepif.c) is not included in the build, but users can still inject the file into compilation process, implement IO interface and use this. - zepif: Copy possibly chained output pbuf properly - Add #define for minimum IPv6 MTU length - pbuf: Add pbuf_copy_partial_pbuf library function * PPPoS: Fix null-deref when processing double break packet - pppos: fix in_tail null (espressif/esp-lwip@537c69d5) - PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da) * NAPT: Fix PBUF_REF type to clone the pbuf before forwarding - IP-FORWARD: If packet-type is PBUF_REF clone it before forwarding - Add NAPT unit test to exercise NAT feature for both RAM and REF pbuf types * version: Update version numbers to match 2.1.2-esp * Minor fixes listed below: Fix client receive KOD, NAPT fixes, restore dhcp_cb, sntp docs, vendor class id (disabled) * Update submodule: espressif/esp-lwip@2195f74...76303df Detailed description of the changes: - test/napt: Add unit test for IP forward with PBUF_REF (espressif/esp-lwip@76303df2) - napt: Fix PBUF_REF type to clone the pbuf before forwarding (espressif/esp-lwip@39068263) - version: Update version numbers to match 2.1.2-esp (espressif/esp-lwip@2b922919) - pppos: fix in_tail null (espressif/esp-lwip@537c69d5) - PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da) - pbuf: Add pbuf_copy_partial_pbuf library function (espressif/esp-lwip@1c9cd9c1) - Add #define for minimum IPv6 MTU length (espressif/esp-lwip@d2dc577b) - zepif: Copy possibly chained output pbuf properly (espressif/esp-lwip@64ab7f2a) - icmp6: Don't copy too much data (espressif/esp-lwip@4a64731b) - icmp6: Fix copying of chained pbuf in reply (espressif/esp-lwip@7c822ff4) - icmp6: keep to the RFC and send as much as possible with icmp6 error messages (espressif/esp-lwip@29100ab6) - dns: Add API to clear dns cache (espressif/esp-lwip@ee59f77d) - CI: Fixed adding gitlab key (espressif/esp-lwip@5a2bdba7) - test case: modify test case test_tcp_new_max_num_remove_FIN_WAIT_1 (espressif/esp-lwip@6b090f7d) - add function for deinit lwip timers (espressif/esp-lwip@2749568f) - dhcp: Fix build issue that set ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER to true will build fail (espressif/esp-lwip@d827dbf7) - Document that sntp_setservername doesn't copy the string (espressif/esp-lwip@54acdb59) #6786 - lwip/dhcp: add 60 option for vendor class identify (espressif/esp-lwip@ae7edc2a) espressif/esp-lwip#32 - dhcp: Restore dhcp_cb on restart after dhcp_release_and_stop() (espressif/esp-lwip@55ea9d9c) #7217 - napt: Fix disbale IPv6 and enable NAPT will build error (espressif/esp-lwip@74cf7f9f) - napt: fix checksum of UDP (espressif/esp-lwip@bb63eed1) - sntp: Fix client receive KOD packet that make pool MEMP_SYS_TIMEOUT not be freed (espressif/esp-lwip@1c1642fe) - test case: add tcp state and reset test cases. (espressif/esp-lwip@67deb805) Closes #8300 Closes #8451
Hello, First of all I'd like to apologize for posting a question rather than an issue but I did not find any other way to figure out how to get DHCP options... Could you please share a piece of code showing how to do it? Thank you in advance. |
* Update submodule: git log --oneline 2195f7416fb3136831babf3e96c027a73075bd4f..6bb132e3797d5449a923804c75c57d458920f8ac Detailed description of the changes: - tcp_in/ooseq: Fix incorrect segment trim when FIN moved (espressif/esp-lwip@6bb132e3) - api_msg: fix tcp_abort thread safety (2.1.2-esp) (espressif/esp-lwip@53a6e019) - lwip:optimization dhcp coarse timer (espressif/esp-lwip@a7abf28e) - napt: Fix ip_portmap_add() to keep only one port mapping (espressif/esp-lwip@abab9fef) - reduce the DHCP Request timeout (espressif/esp-lwip@6fa02bd3) - lwip timer:optimization dhcp fine timer (espressif/esp-lwip@79182163) - optimization lwip ip4 reassembly timer (espressif/esp-lwip@17f41c9f) - optimization lwip ip6 reassembly timer (espressif/esp-lwip@c943fc5a) - optimization lwip dns timer (espressif/esp-lwip@7f5ab42c) - napt: Fix clean compilation (espressif/esp-lwip@6132c975) - Lwip:add TCP Fin2 timeout configuration (espressif/esp-lwip@15b4400e) - napt: Fix IP forwarding when forward netif enable NAPT (espressif/esp-lwip@c950063f) - napt/stats: Move some napt counters to stats module (espressif/esp-lwip@475d658a) - ip_napt_maint: Fix timestamp overflow handling (espressif/esp-lwip@2e904508) - napt: Fixes and improvements (espressif/esp-lwip@fb1f3552) - test/napt: Add unit test for IP forward with PBUF_REF (espressif/esp-lwip@76303df2) - napt: Fix PBUF_REF type to clone the pbuf before forwarding (espressif/esp-lwip@39068263) - version: Update version numbers to match 2.1.2-esp (espressif/esp-lwip@2b922919) - pppos: fix in_tail null (espressif/esp-lwip@537c69d5) - PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da) - pbuf: Add pbuf_copy_partial_pbuf library function (espressif/esp-lwip@1c9cd9c1) - Add #define for minimum IPv6 MTU length (espressif/esp-lwip@d2dc577b) - zepif: Copy possibly chained output pbuf properly (espressif/esp-lwip@64ab7f2a) - icmp6: Don't copy too much data (espressif/esp-lwip@4a64731b) - icmp6: Fix copying of chained pbuf in reply (espressif/esp-lwip@7c822ff4) - icmp6: keep to the RFC and send as much as possible with icmp6 error messages (espressif/esp-lwip@29100ab6) - dns: Add API to clear dns cache (espressif/esp-lwip@ee59f77d) - CI: Fixed adding gitlab key (espressif/esp-lwip@5a2bdba7) - test case: modify test case test_tcp_new_max_num_remove_FIN_WAIT_1 (espressif/esp-lwip@6b090f7d) - add function for deinit lwip timers (espressif/esp-lwip@2749568f) - dhcp: Fix build issue that set ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER to true will build fail (espressif/esp-lwip@d827dbf7) - Document that sntp_setservername doesn't copy the string (espressif/esp-lwip@54acdb59) - Closes #6786 - lwip/dhcp: add 60 option for vendor class identify (espressif/esp-lwip@ae7edc2a) - Closes espressif/esp-lwip#32 - dhcp: Restore dhcp_cb on restart after dhcp_release_and_stop() (espressif/esp-lwip@55ea9d9c) - Closes #7217 - napt: Fix disbale IPv6 and enable NAPT will build error (espressif/esp-lwip@74cf7f9f) - napt: fix checksum of UDP (espressif/esp-lwip@bb63eed1) - sntp: Fix client receive KOD packet that make pool MEMP_SYS_TIMEOUT not be freed (espressif/esp-lwip@1c1642fe) - test case: add tcp state and reset test cases. (espressif/esp-lwip@67deb805)
Is your feature request related to a problem? Please describe.
We are developing a new ESP32 based product that should receive its configuration from network's DHCP server. We have investigated esp-idf's DHCP client, but currently it does not support sending or receiving DHCP options 43 (Vendor Specific Information) and 60 (Vendor Class Identifier (VCI)).
Describe the solution you'd like
Could we extend the capabilities of the DHCP client, so that we could:
Describe alternatives you've considered
We are experimenting with requesting this information via UDP packets to the DHCP server, but as it is not possible to set the proper UDP source port, such implementation would be non-compliant.
Additional context
Explanation of the options:
https://docs.paloaltonetworks.com/pan-os/8-1/pan-os-admin/networking/dhcp/dhcp-options/dhcp-options-43-55-and-60-and-other-customized-options.html
Currently supported DHCP options in esp-idf:
The text was updated successfully, but these errors were encountered: