summaryrefslogtreecommitdiffstats
path: root/src/net/ipv4.c
diff options
context:
space:
mode:
authorMichael Brown2011-06-28 11:21:30 +0200
committerMichael Brown2011-06-28 11:21:30 +0200
commitcc7c2a9dcd3d501561bcc7ef67c67601404248bf (patch)
tree71fa3d01057abbca969ada9d3f9aa7614a8f1745 /src/net/ipv4.c
parent[netdevice] Allow non-completion TX errors to be recorded (diff)
downloadipxe-cc7c2a9dcd3d501561bcc7ef67c67601404248bf.tar.gz
ipxe-cc7c2a9dcd3d501561bcc7ef67c67601404248bf.tar.xz
ipxe-cc7c2a9dcd3d501561bcc7ef67c67601404248bf.zip
[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 <dominik.russenberger@terreactive.ch> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/ipv4.c')
-rw-r--r--src/net/ipv4.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net/ipv4.c b/src/net/ipv4.c
index 465df45e..5bb48f61 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;
}