DHCP requesting additional options via option 55

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DHCP requesting additional options via option 55

Craig McQueen
I have tried using LWIP_HOOK_DHCP_APPEND_OPTIONS() and LWIP_HOOK_DHCP_PARSE_OPTION() to request additional DHCP options from the server, using DHCP option 55 (DHCP_OPTION_PARAMETER_REQUEST_LIST).

At first I thought it was working fine. But on closer examination, it seems the server is not sending all requested options (e.g. options 3 and 6). That is evidently because the DHCP request contains the option 55 twice (once from the lwIP core code, a second time from my LWIP_HOOK_DHCP_APPEND_OPTIONS()). According to the DHCP RFC 2131, " Options may appear only once, unless otherwise specified in the options document." So I guess the DHCP server (Microsoft in this case) is ignoring the first occurrence of option 55.

So, it would be good to improve the DHCP hook mechanism so that user code can request additional options via option 55, without duplicating the option contrary to the RFC. Ideally, it could be dynamic not a static array, so the user code could decide at run-time which additional options are requested.

What would be a good way to improve the hook mechanism?

(I'm interested in contributing some code back to the lwIP project, as long as I have a rough idea what would be accepted.)

--
Craig McQueen


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP requesting additional options via option 55

Craig McQueen
I wrote:

>
> I have tried using LWIP_HOOK_DHCP_APPEND_OPTIONS() and
> LWIP_HOOK_DHCP_PARSE_OPTION() to request additional DHCP options
> from the server, using DHCP option 55
> (DHCP_OPTION_PARAMETER_REQUEST_LIST).
>
> At first I thought it was working fine. But on closer examination, it seems the
> server is not sending all requested options (e.g. options 3 and 6). That is
> evidently because the DHCP request contains the option 55 twice (once from
> the lwIP core code, a second time from my
> LWIP_HOOK_DHCP_APPEND_OPTIONS()). According to the DHCP RFC 2131, "
> Options may appear only once, unless otherwise specified in the options
> document." So I guess the DHCP server (Microsoft in this case) is ignoring the
> first occurrence of option 55.
>
> So, it would be good to improve the DHCP hook mechanism so that user code
> can request additional options via option 55, without duplicating the option
> contrary to the RFC. Ideally, it could be dynamic not a static array, so the user
> code could decide at run-time which additional options are requested.
>
> What would be a good way to improve the hook mechanism?
>
> (I'm interested in contributing some code back to the lwIP project, as long as
> I have a rough idea what would be accepted.)

I worked out that in LWIP_HOOK_DHCP_APPEND_OPTIONS(), I can actually do a search through the existing options in msg->options[], looking for any pre-existing DHCP_OPTION_PARAMETER_REQUEST_LIST. Then I can insert the extra options into it. It's a bit fiddly, but I've got it working. Does that sound like a reasonable thing to do in LWIP_HOOK_DHCP_APPEND_OPTIONS()?

--
Craig McQueen


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP requesting additional options via option 55

goldsimon@gmx.de


Am 13. November 2018 06:10:32 MEZ schrieb Craig McQueen <[hidden email]>:

>I wrote:
>>
>> I have tried using LWIP_HOOK_DHCP_APPEND_OPTIONS() and
>> LWIP_HOOK_DHCP_PARSE_OPTION() to request additional DHCP options
>> from the server, using DHCP option 55
>> (DHCP_OPTION_PARAMETER_REQUEST_LIST).
>>
>> At first I thought it was working fine. But on closer examination, it
>seems the
>> server is not sending all requested options (e.g. options 3 and 6).
>That is
>> evidently because the DHCP request contains the option 55 twice (once
>from
>> the lwIP core code, a second time from my
>> LWIP_HOOK_DHCP_APPEND_OPTIONS()). According to the DHCP RFC 2131, "
>> Options may appear only once, unless otherwise specified in the
>options
>> document." So I guess the DHCP server (Microsoft in this case) is
>ignoring the
>> first occurrence of option 55.
>>
>> So, it would be good to improve the DHCP hook mechanism so that user
>code
>> can request additional options via option 55, without duplicating the
>option
>> contrary to the RFC. Ideally, it could be dynamic not a static array,
>so the user
>> code could decide at run-time which additional options are requested.
>>
>> What would be a good way to improve the hook mechanism?
>>
>> (I'm interested in contributing some code back to the lwIP project,
>as long as
>> I have a rough idea what would be accepted.)
>
>I worked out that in LWIP_HOOK_DHCP_APPEND_OPTIONS(), I can actually do
>a search through the existing options in msg->options[], looking for
>any pre-existing DHCP_OPTION_PARAMETER_REQUEST_LIST. Then I can insert
>the extra options into it. It's a bit fiddly, but I've got it working.
>Does that sound like a reasonable thing to do in
>LWIP_HOOK_DHCP_APPEND_OPTIONS()?

No. That seems too complicated. I would prefer a seaparate method.

Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users