diff -urN ../netkit-base-0.10/inetd/inetd.c ./inetd/inetd.c
--- ../netkit-base-0.10/inetd/inetd.c	Wed Apr  5 04:07:22 2000
+++ ./inetd/inetd.c	Tue May 14 18:32:22 2002
@@ -140,6 +140,10 @@
 #include <sys/resource.h>
 
 #include <netinet/in.h>
+#ifdef __NetBSD__
+#include <netinet/in_systm.h>
+#include <stdlib.h>
+#endif
 #include <netinet/ip.h>
 #include <arpa/inet.h>
 
@@ -1263,6 +1267,7 @@
 	exit(-1);
 }
 
+#ifndef __NetBSD__
 static void
 setproctitle(char *a, int s)
 {
@@ -1282,6 +1287,7 @@
 	while (cp < LastArg)
 		*cp++ = ' ';
 }
+#endif /* __NetBSD__ */
 
 static void
 logpid(void)
diff -urN ../netkit-base-0.10/ping/ping.c ./ping/ping.c
--- ../netkit-base-0.10/ping/ping.c	Tue May 14 18:32:38 2002
+++ ./ping/ping.c	Tue May 14 18:31:51 2002
@@ -70,6 +70,11 @@
 #include <time.h>
 
 #include <netinet/in.h>
+#ifdef __NetBSD__
+#include <netinet/in_systm.h>
+#include <ip_var.h>
+#include "ping.h"
+#endif 
 #include <netinet/ip.h>
 #include <netinet/ip_icmp.h>
 #include <arpa/inet.h>
@@ -90,9 +95,9 @@
 #define SAFE_TO_DROP_ROOT
 #endif
 
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+#if (defined(__GLIBC__) && (__GLIBC__ >= 2)) || defined __NetBSD__
 #define icmphdr			icmp
-#ifdef NEED_ICMP_HEADERS
+#if defined (NEED_ICMP_HEADERS) || defined (__NetBSD__)
 #define ICMP_DEST_UNREACH	ICMP_UNREACH
 #define ICMP_NET_UNREACH	ICMP_UNREACH_NET
 #define ICMP_HOST_UNREACH	ICMP_UNREACH_HOST
@@ -230,9 +235,12 @@
 #endif
 
 	static char *null = NULL;
+#ifndef __NetBSD__
 	__environ = &null;
+#endif
 	am_i_root = (getuid()==0);
 
+
 	/*
 	 * Pull this stuff up front so we can drop root if desired.
 	 */
@@ -578,7 +586,7 @@
 	}
 }
 
-#if !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if (!defined(__GLIBC__) || (__GLIBC__ < 2)) || !defined (__NetBSD__) 
 #define icmp_type type
 #define icmp_code code
 #define icmp_cksum checksum
diff -urN ../netkit-base-0.10/ping/ping.h ./ping/ping.h
--- ../netkit-base-0.10/ping/ping.h	Thu Jan  1 00:00:00 1970
+++ ./ping/ping.h	Tue May 14 18:32:22 2002
@@ -0,0 +1,23 @@
+struct iphdr
+  {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+    unsigned int ihl:4;
+    unsigned int version:4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+    unsigned int version:4;
+    unsigned int ihl:4;
+#else
+# error "Please fix <bits/endian.h>"
+#endif
+    u_int8_t tos;
+    u_int16_t tot_len;
+    u_int16_t id;
+    u_int16_t frag_off;
+    u_int8_t ttl;
+    u_int8_t protocol;
+    u_int16_t check;
+    u_int32_t saddr;
+    u_int32_t daddr;
+    /*The options start here. */
+  };
+
diff -urN ../netkit-base-0.10/rpcinfo/rpcinfo.c ./rpcinfo/rpcinfo.c
--- ../netkit-base-0.10/rpcinfo/rpcinfo.c	Mon Nov 25 18:42:55 1996
+++ ./rpcinfo/rpcinfo.c	Tue May 14 18:32:22 2002
@@ -48,6 +48,10 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#ifdef __NetBSD__
+#include <netinet/in_systm.h>
+#include <stdlib.h>
+#endif
 #include <netinet/ip.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
