$OpenBSD: patch-src_fping_c,v 1.2 2015/12/02 12:40:04 jca Exp $
--- src/fping.c.orig	Wed Oct 21 21:02:56 2015
+++ src/fping.c	Wed Dec  2 08:22:39 2015
@@ -369,6 +369,9 @@ int main( int argc, char **argv )
         setuid( getuid() );
     }
 
+    if (pledge("stdio inet rpath dns", NULL) == -1)
+        perror("pledge");
+
     prog = argv[0];
     ident = getpid() & 0xFFFF;
     verbose_flag = 1;
@@ -561,6 +564,11 @@ int main( int argc, char **argv )
         }/* SWITCH */
     }/* WHILE */
 
+    if (!filename) { /* drop rpath if not reading addrs from file */
+        if (pledge("stdio inet dns", NULL) == -1)
+            perror("pledge");
+    }
+
     /* validate various option settings */
 
     if (ttl > 255) {
@@ -776,6 +784,14 @@ int main( int argc, char **argv )
     else {
         usage(1);
     }
+
+    if (name_flag) { /* done with file, drop rpath */
+        if (pledge("stdio inet dns", NULL) == -1)
+            perror("pledge");
+    } else { /* and drop dns unless we do reverse lookups */
+        if (pledge("stdio inet", NULL) == -1)
+            perror("pledge");
+    }
     
     if( !num_hosts )
         exit(1);
@@ -1493,7 +1509,7 @@ int wait_for_reply(long wait_time)
     ip = ( struct ip* )buffer;
 
 #ifndef IPV6
-#if defined( __alpha__ ) && __STDC__ && !defined( __GLIBC__ )
+#if defined( __alpha__ ) && __STDC__ && !defined( __GLIBC__ ) && !defined(__OpenBSD__)
     /* The alpha headers are decidedly broken.
      * Using an ANSI compiler, it provides ip_vhl instead of ip_hl and
      * ip_v.  So, to get ip_hl, we mask off the bottom four bits.
