[ipxe-devel] [PATCH 2/3] igbvf: Assign random MAC address if none is set

Michael Brown mcb30 at ipxe.org
Sun Jun 1 22:36:11 UTC 2014


On 30/05/14 15:19, Hannes Reinecke wrote:
>> This is something which is probably generic enough to justify a
>> function such as eth_random_addr() in net/ethernet.c.  Would you be
>> willing to reimplement your patch in that way (and without the
>> current whitespace-only changes)?
>>
> Updated patch attached.

Thanks!  I've pushed the generic parts:

   http://git.ipxe.org/ipxe.git/commitdiff/d630052

but there is one part of the igbvf driver change which I don't understand:

  	if ( mac->ops.reset_hw(hw) )
  		DBG ("PF still resetting\n");

+	if ( is_valid_ether_addr( netdev->hw_addr )) {
+		memcpy ( adapter->hw.mac.addr, netdev->hw_addr, ETH_ALEN);
+	}
+
  	mac->ops.init_hw ( hw );

  	if ( is_valid_ether_addr(adapter->hw.mac.addr) ) {

What does this code do?

Thanks,

Michael



More information about the ipxe-devel mailing list