[ipxe-devel] e1000[e] MAC address changing / Possible IPv4/DHCP bug
Thomas Miletich
thomas.miletich at gmail.com
Thu Feb 16 16:04:23 UTC 2012
Hello,
as someone else on the mailing list discovered the e1000 and e1000e
drivers don't support changing the MAC address.
I thought about writing a patch that moves the MAC address setup to
_open(). While this works I'm not sure if this is (still)the proper
way to do things in iPXE.
Commit da222e6f3c ("[rtl8139] Operate in promiscuous mode") suggests
that cards are supposed to operate in promiscuous mode.
This leads to my first question: Would the proper way to fix e1000 and
e1000e be to put the card into promiscuous mode and don't write the
MAC address to the card at all?
While testing this I also discovered what looks like a bug in the IPv4
or DHCP code.
Using a driver that supports MAC address changing(tested with patched
e1000e, sis190 and rtl8139) the following thing works as expected:
set net0/mac 00:11:22:33:44:55
dhcp net0
The card communicates with the user-specified MAC address and received
an IP from the dhcp server as expected.
When I instead try the following commands:
dhcp net0 # works as expected
ifclose net0
set net0/mac 00:11:22:33:44:55
dhcp net0 # times out
The second DHCP command times out, when I enable ipv4 debugging
messages I see that the DHCP offer packets get discarded with a
"IPv4 discarding non-local unicast packet for <IP" message. I assume
this is caused by iPXE already having an IP, while the DHCP server now
offers a different IP in the second request because of the different
MAC address.
If I do:
set net0/ip 0.0.0.0
before the second DHCP request, iPXE accepts the DHCP offer and the
'dhcp' commands terminates with the expected 'OK' message. For some
reason however it doesn't assign the received IP to the interface, and
show net0/ip
still says the IP is '0.0.0.0'.
Thomas
More information about the ipxe-devel
mailing list