[ipxe-devel] [PATCH 3/3] Set correct 'origin' field in iBFT structure
Michael Brown
mcb30 at ipxe.org
Mon Jun 2 16:00:34 UTC 2014
On 02/06/14 07:08, Hannes Reinecke wrote:
>> This is interesting. The test as you've written it will detect if
>> DHCP was ever performed on the network device. If an address was
>> obtained via DHCP and then overridden with a static address using
>> "set net0/ip x.x.x.x" then the DHCP settings block will still exist
>> and so the code would end up reporting DHCP as the origin of the
>> address.
>>
> Well, that above check was the closest I could find.
> And I would have expected that any manual settings later on should
> override / remove that setting.
Setting a manual IP address will override the DHCP-provided IP address,
but won't remove the DHCP settings block.
We can use fetch_setting() to determine the settings block from which
the setting is taken. The best approach might therefore be to use
"manual" if the IP address setting comes from the "net0" block itself,
or "DHCP" otherwise. It won't be perfect, but it's probably a
reasonable heuristic.
Michael
More information about the ipxe-devel
mailing list