]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ipv4] Record ARP resolution errors
authorMichael Brown <mcb30@ipxe.org>
Tue, 28 Jun 2011 09:21:30 +0000 (10:21 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 28 Jun 2011 09:21:30 +0000 (10:21 +0100)
At the time of attempting ARP resolution, we already know the
transmitting network device.  We can therefore record ARP errors using
netdev_tx_err() so that they show up in the output of "ifstat".

Inspired-by: Dominik Russenberger <dominik.russenberger@terreactive.ch>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/ipv4.c

index 465df45e0acdf1d90cf7b9480c8c11286976c4fe..5bb48f61ca8063f762df4ed37559a287f7c7a6a5 100644 (file)
@@ -347,6 +347,8 @@ static int ipv4_tx ( struct io_buffer *iobuf,
                                   ll_dest ) ) != 0 ) {
                DBG ( "IPv4 has no link-layer address for %s: %s\n",
                      inet_ntoa ( next_hop ), strerror ( rc ) );
+               /* Record error for diagnosis */
+               netdev_tx_err ( netdev, iob_disown ( iobuf ), rc );
                goto err;
        }