aboutgitcodebugslistschat
path: root/icmp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-01-16 16:16:16 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-01-22 23:36:53 +0100
commit6e86511f596794f987ca1114d5681e85f91eaed3 (patch)
tree0f196307ff507e215d6f7a3e8d6355aaf1d96d44 /icmp.c
parenta325121759ad5a78bd79749f0a520d2ebfb72120 (diff)
downloadpasst-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>
Diffstat (limited to 'icmp.c')
-rw-r--r--icmp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/icmp.c b/icmp.c
index 88390fb..79f6c8c 100644
--- a/icmp.c
+++ b/icmp.c
@@ -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;