[ipxe-devel] [PATCH 3/3] Set correct 'origin' field in iBFT structure

Hannes Reinecke hare at suse.de
Mon Jun 2 06:08:05 UTC 2014


On 06/02/2014 12:39 AM, Michael Brown wrote:
> On 30/05/14 08:18, Hannes Reinecke wrote:
>> The iBFT structure has an 'origin' field, which should specify
>> the IP address origin. As we can do dhcp we should be filling
>> in this structure to give the OS an indication here.
>>
>> +    /* Fill in origin */
>> +    parent = netdev_settings( netdev );
>> +    if (find_child_settings( parent, DHCP_SETTINGS_NAME ) != NULL)
>> +        nic->origin = IBFT_NIC_ORIGIN_DHCP;
>> +    else
>> +        nic->origin = IBFT_NIC_ORIGIN_MANUAL;
>> +
>
> 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.
If that isn't the case we need to work on that; either by indeed
removing that section or adding another field which we can use as an 
indicator.

> What does the origin field get used for?  Given that the iBFT NIC
> structure contains multiple settings which can come from different
> sources (e.g. IP address, DNS server, hostname), how ought we to
> determine which origin to report?
>
 From my understanding the 'origin' field refers to the IP address 
and related settings (ie ip address, netmask, and gateway).
Everything else is not relevant here, seeing as it is being
used for iSCSI.

And we need the 'origin' field when we're setting up the network
configuration in the OS. If the IP address was obtained via DHCP
we really want to know about it; otherwise the lease might expire 
and the DHCP server might decide to assign the address to someone else.
Highly unlikely, I know. But can happen in principle.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare at suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)



More information about the ipxe-devel mailing list