Index: packet/probe_unix.c
--- packet/probe_unix.c.orig
+++ packet/probe_unix.c
@@ -812,7 +812,7 @@ void receive_replies_from_recv_socket(
             }
         }
 
-#ifdef SO_PROTOCOL
+#if defined(SO_PROTOCOL) && defined(HAVE_LINUX_ERRQUEUE_H)
         if (icmp_connrefused_received) {
             /* using ICMP type ICMP_ECHOREPLY is not a bug, it is an
                indication of successfully reaching dst host.
