From: Michael Brown Date: Tue, 28 Jun 2011 09:21:30 +0000 (+0100) Subject: [ipv4] Record ARP resolution errors X-Git-Tag: v1.20.1~2116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc7c2a9dcd3d501561bcc7ef67c67601404248bf;p=thirdparty%2Fipxe.git [ipv4] Record ARP resolution errors 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 Signed-off-by: Michael Brown --- diff --git a/src/net/ipv4.c b/src/net/ipv4.c index 465df45e0..5bb48f61c 100644 --- a/src/net/ipv4.c +++ b/src/net/ipv4.c @@ -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; }