2

Where can I change the configs of the dhcp options when sending a dhcp request with the LwIP library?

I need to set option 53 (DHCP message type (discover)), 61 (client identifier), 12 (host name), 60 (vendor class identifier) and 55 (parameter request list).

I created my project with CubeMx on stm32f7.

1 Answer 1

2

Unfortunately, not all DHCP options are exposed in the lwIP API (as of lwIP 2.0.3). Option 12 can be enabled with the LWIP_NETIF_HOSTNAME define. For the others, you'll have to add support in src\core\ipv*\dhcp.c . See the dhcp_discover and the dhcp_parse_reply functions.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm now able to add the options. It doesn't work very well with CubeMx because all the modifications in src\core\ipv*\dhcp.c disappear every time I regenerate the code, but I'll just copy/paste again everytime. Thank you.
@MasterRem I would be wary of a tool that overwrites your source files like that. I'd recommend using version control (e.g. Subversion or git) to safely manage your code development.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.