diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-01-16 16:16:16 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-01-22 23:36:53 +0100 |
commit | 6e86511f596794f987ca1114d5681e85f91eaed3 (patch) | |
tree | 0f196307ff507e215d6f7a3e8d6355aaf1d96d44 | |
parent | a325121759ad5a78bd79749f0a520d2ebfb72120 (diff) | |
download | passt-6e86511f596794f987ca1114d5681e85f91eaed3.tar passt-6e86511f596794f987ca1114d5681e85f91eaed3.tar.gz passt-6e86511f596794f987ca1114d5681e85f91eaed3.tar.bz2 passt-6e86511f596794f987ca1114d5681e85f91eaed3.tar.lz passt-6e86511f596794f987ca1114d5681e85f91eaed3.tar.xz passt-6e86511f596794f987ca1114d5681e85f91eaed3.tar.zst passt-6e86511f596794f987ca1114d5681e85f91eaed3.zip |
icmp: Warn on receive errors from ping sockets
Currently we silently ignore an errors receiving a packet from a ping
socket. We don't expect that to happen, so it's probably worth reporting
if it does.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | icmp.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -81,8 +81,11 @@ void icmp_sock_handler(const struct ctx *c, int af, union epoll_ref ref) return; n = recvfrom(ref.fd, buf, sizeof(buf), 0, &sr.sa, &sl); - if (n < 0) + if (n < 0) { + warn("%s: recvfrom() error on ping socket: %s", + pname, strerror(errno)); return; + } if (af == AF_INET) { struct icmphdr *ih4 = (struct icmphdr *)buf; |