Obtaining an IPv4 address via DHCP is probably the simplest test of the complete transmit and receive datapath. This test should therefore be attempted before any of the more complex datapath tests.
net0
).dhcp net0
.route
to verify that the assigned IPv4 address is in the expected range.
The easiest way to troubleshoot this test is typically to use a combination of DEBUG
build options, the error counters displayed by ifstat
, and a packet capture on the DHCP server.
Start by verifying that the DHCP request is transmitted intact; there's no point attempting to debug your receive datapath (which is generally more complex) until the transmit datapath is working as expected.
Once transmit is definitely working (as verified by being able to observe both your DHCP request and the server's DHCP response on the wire), then check the receive errors (RXE) reported by ifstat
. In particular, look for errors such as http://ipxe.org/3c086003 which could indicate that your driver is receiving empty or garbage data. You may need to start dumping the contents of received packets in your driver using code such as:
// temporary hack - dump content of received packet DBGC_HDA ( netdev, 0, iobuf->data, iob_len ( iobuf ) );
Check that your driver is actually filling in the length of received packets using iob_put()
; if not, then iPXE will see all received packets as having zero length.