-
Notifications
You must be signed in to change notification settings - Fork 13.3k
added weak fnc add_custom_offer_options #8451
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
Conversation
I'm not sure what/how to do anything with the workflow. Please let me know if I need to do anything there. |
@bwjohns4 the CI failed due to indent/spacing issues. Run |
@earlephilhower , do I just run that script from the root of the repo directory? I ran it there and nothing appears to have changed to the file. Do I need to pass any arguments into the script? Here are the error messages that I get: |
Your screenshot looks like Ubuntu terminal. |
Arduino/cores/esp8266/LwipDhcpServer.cpp Line 72 in 9fcf14f
Arduino/cores/esp8266/LwipDhcpServer.cpp Line 532 in 9fcf14f
This code is an as-is-copy of the original espressif dhcp server from the initial lwip-1.4. |
Where in Arduino is the DCHP server instantiated and where in user/library code would this happen? What about adding a setter to the DHCPserver class to pass in custom options as well as a bool pointer that can be used to pass back true or false success of adding in the custom options. Then when it's time to add the custom options just check that How does this align with your suggestion of the linked list callable from |
It is globally instantiated. Nonosdk firmware initially calls
This API can be overloaded if one need to separately add more options, which I doubt. |
What would be the use case for the linked list here? Build a linked list of options and their associated parameters to add? |
No. It was in case dhcp options would have to be added more than once and from different locations in user code. Lets keep it simple. I think your PR will be fine if you add a size parameter to the weak function. edit after #8571 review Size is the first byte of user data pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
This probably should be merged before #8546
...it would make sense to re-do this as a class method though? |
So I've got a draft after redoing this to use class methods and move away from the weak function idea. I'll do some testing and push that here asap. |
Here is an attempt to incorporate add_custom_offer_options(). This is a weak function that is called at the end of add_offer_options() that allows another library to redefine the function to hook into and add custom DHCP options.
One question I have is what restrains the size of optptr? How much can it grow (via *optprt++) before causing problems? Is it in an allocated space already?