$OpenBSD: patch-packet_probe_unix_c,v 1.2 2021/09/02 17:06:14 fcambus Exp $

Index: packet/probe_unix.c
--- packet/probe_unix.c.orig
+++ packet/probe_unix.c
@@ -137,7 +137,7 @@ void check_length_order(
     ssize_t bytes_sent;
     int packet_size;
 
-#ifdef __linux__
+#ifdef __linux__        // #if defined(__linux__) || defined(__OpenBSD__)
     /*  Linux will accept either byte order and check below fails to work
      *  in some cases due to sendto() returning EPERM. */
     return;
@@ -805,7 +805,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.
