Index: command.c
--- command.c.orig	2006-08-19 09:10:40 +0200
+++ command.c	2006-08-24 12:14:21 +0200
@@ -72,6 +72,9 @@
 #include "pyextend.h"
 #include "honeyd_overload.h"
 #include "util.h"
+#ifndef HAVE_SETENV
+#include "setenv.h"
+#endif
 
 ssize_t atomicio(ssize_t (*)(), int, void *, size_t);
 
Index: compat/getopt.h
--- compat/getopt.h.orig	2006-08-19 09:10:40 +0200
+++ compat/getopt.h	2006-08-24 12:14:21 +0200
@@ -40,7 +40,11 @@
 #ifndef _GETOPT_H_
 #define _GETOPT_H_
 
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#else
+#include "cdefs.h"
+#endif
 
 /*
  * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
Index: compat/sha1.h
--- compat/sha1.h.orig	2006-08-19 09:10:40 +0200
+++ compat/sha1.h	2006-08-24 12:14:21 +0200
@@ -15,7 +15,11 @@
     unsigned char buffer[64];
 } SHA1_CTX;
 
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#else
+#include "cdefs.h"
+#endif
 
 __BEGIN_DECLS
 void SHA1Transform(u_int32_t [5], const unsigned char [64])
Index: config.h.in
--- config.h.in.orig	2006-01-17 18:11:44 +0100
+++ config.h.in	2006-08-24 12:14:21 +0200
@@ -222,6 +222,9 @@
 /* Define to 1 if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
 /* Define if your system defines struct sockaddr_storage */
 #undef HAVE_STRUCT_SOCKADDR_STORAGE
 
@@ -255,6 +258,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#undef HAVE_SYS_CDEFS_H
+
 /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
 #undef HAVE_SYS_WAIT_H
 
Index: dhcpclient.c
--- dhcpclient.c.orig	2006-08-19 09:10:41 +0200
+++ dhcpclient.c	2006-08-24 12:14:21 +0200
@@ -94,6 +94,13 @@
 
 #define NTRIES 10
 
+#ifndef MIN
+# define MIN(a,b)	(((a) < (b)) ? (a) : (b))
+#endif /* MIN */
+#ifndef MAX
+# define MAX(a,b)	(((a) > (b)) ? (a) : (b))
+#endif /* MAX */
+
 static int  _pack_request(struct dhcpclient_req *, void *, size_t *);
 static int  _pack_release(struct dhcpclient_req *, void *, size_t *);
 static int  _bcast(struct template *,
Index: honeyd.c
--- honeyd.c.orig	2006-08-19 09:14:36 +0200
+++ honeyd.c	2006-08-24 12:14:21 +0200
@@ -101,6 +101,9 @@
 #include "histogram.h"
 #include "update.h"
 #include "util.h"
+#ifndef HAVE_SETENV
+#include "setenv.h"
+#endif
 
 #ifdef HAVE_PYTHON
 #include <Python.h>
Index: honeyd_overload.c
--- honeyd_overload.c.orig	2006-08-19 09:10:41 +0200
+++ honeyd_overload.c	2006-08-24 12:14:21 +0200
@@ -295,7 +295,7 @@
 	struct fd *nfd;
 	int pair[2];
 
-	if (socketpair(AF_LOCAL, type, 0, pair) == -1) {
+	if (socketpair(AF_UNIX, type, 0, pair) == -1) {
 		warn("%s: socketpair", __func__);
 		return (NULL);
 	}
@@ -625,7 +625,7 @@
 	}
 
 	/* Get another socketpair */
-	if (socketpair(AF_LOCAL, SOCK_STREAM, 0, pair) == -1) {
+	if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) {
 		DPRINTF((stderr, "%s: socketpair failed", __func__));
 		errno = ETIMEDOUT; /* XXX */
 		return (-1);
@@ -732,6 +732,7 @@
 }
 #endif /* !__FreeBSD__ */
 
+#ifndef sun
 ssize_t
 recvfrom(int sock, void *buf, size_t len, int flags, struct sockaddr *from,
     socklen_t *fromlen)
@@ -759,6 +760,7 @@
  out:
 	return (ret);
 }
+#endif /* !sun */
 
 ssize_t
 sendto(int sock, const void *buf, size_t len, int flags,
@@ -795,6 +797,7 @@
 	return (ret);
 }
 
+#ifndef sun
 int
 getsockname(int sock, struct sockaddr *to, socklen_t *tolen)
 {
@@ -832,6 +835,7 @@
 
 	return (0);
 }
+#endif /* !sun */
 
 ssize_t
 recvmsg(int sock, struct msghdr *msg, int flags)
@@ -1120,6 +1124,7 @@
 	return (ret);
 }
 
+#ifndef sun
 int
 accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
 {
@@ -1169,6 +1174,7 @@
 
 	return (fd);
 }
+#endif /* !sun */
 
 #if 0
 
Index: personality.c
--- personality.c.orig	2006-08-19 09:10:40 +0200
+++ personality.c	2006-08-24 12:14:21 +0200
@@ -32,6 +32,9 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
+#ifndef UINT_MAX
+#define UINT_MAX    4294967295U
+#endif
 
 #include "config.h"
 
Index: pf_osfp.c
--- pf_osfp.c.orig	2006-08-19 09:10:40 +0200
+++ pf_osfp.c	2006-08-24 12:14:21 +0200
@@ -50,6 +50,10 @@
 #  define DPFPRINTF(format, x...)	((void)0)
 # endif /* PFDEBUG */
 
+#ifndef MAX
+# define MAX(a,b)  (((a) > (b)) ? (a) : (b))
+#endif
+
 SLIST_HEAD(pf_osfp_list, pf_os_fingerprint) pf_osfp_list;
 pool_t pf_osfp_entry_pl;
 pool_t pf_osfp_pl;
Index: nmap.prints
--- nmap.prints.orig	2007-05-28 08:05:05.000000000 +0200
+++ nmap.prints	2012-10-02 20:41:53.110772932 +0200
@@ -662,18 +662,6 @@
 T7(DF=N%W=0%ACK=S%Flags=AR%Ops=)
 PU(DF=N%TOS=0%IPLEN=38%RIPTL=15C%RID=E%RIPCK=0%UCK=0%ULEN=134%DAT=E)
 
-Fingerprint IBM OS/400 V4R2M0
-Class IBM | OS/400 | V4 | general purpose
-TSeq(Class=TD|RI%gcd=<6%SI=<285DC&>206%IPID=I%TS=U)
-T1(DF=N%W=8000%ACK=S++%Flags=AS%Ops=M)
-T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=)
-T3(Resp=Y%DF=N%W=8000%ACK=S++%Flags=AS%Ops=M)
-T4(DF=N%W=0%ACK=S%Flags=R%Ops=)
-T5(DF=N%W=0%ACK=S++%Flags=AR%Ops=)
-T6(DF=N%W=0%ACK=S%Flags=R%Ops=)
-T7(DF=N%W=0%ACK=S++%Flags=AR%Ops=)
-PU(DF=N%TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E)
-
 Fingerprint IBM OS/400 V4R5M0
 Class IBM | OS/400 | V4 | general purpose
 T1(DF=N%W=2000%ACK=S++%Flags=AS%Ops=MNWNNT)
@@ -11085,18 +11073,6 @@
 
 Fingerprint Microsoft Windows NT 4.0 SP3
 Class Microsoft | Windows | NT/2K/XP | general purpose
-TSeq(Class=TD|RI%gcd=<18%SI=<2A00DA&>6B73)
-T1(DF=Y%W=7FFF|2017%ACK=S++%Flags=AS%Ops=M|MNWNNT)
-T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=)
-T3(Resp=Y%DF=Y%W=7FFF|2017%ACK=S++|O%Flags=AS|A%Ops=M|NNT)
-T4(DF=N%W=0%ACK=O|S%Flags=R%Ops=)
-T5(DF=N%W=0%ACK=S++%Flags=AR%Ops=)
-T6(DF=N%W=0%ACK=O|S++%Flags=R%Ops=)
-T7(DF=N%W=0%ACK=S++%Flags=AR%Ops=)
-PU(TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E)
-
-Fingerprint Microsoft Windows NT 4.0 SP3
-Class Microsoft | Windows | NT/2K/XP | general purpose
 TSeq(Class=TD%gcd=<F4%SI=<3C%IPID=BI%TS=U)
 T1(DF=Y%W=2017%ACK=S++%Flags=AS%Ops=M)
 T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=)
Index: interface.c
--- interface.c.orig	2007-05-28 08:12:52.000000000 +0200
+++ interface.c	2012-10-02 21:16:53.229492754 +0200
@@ -114,6 +114,7 @@
 {
 	char ebuf[PCAP_ERRBUF_SIZE];
 	struct interface *inter;
+	char *iface = 0;
 
 	if ((inter = calloc(1, sizeof(struct interface))) == NULL)
 		err(1, "%s: calloc", __func__);
@@ -126,14 +127,23 @@
 	TAILQ_INSERT_TAIL(&interfaces, inter, next);
 
 	inter->if_ent.intf_len = sizeof(struct intf_entry);
-	strlcpy(inter->if_ent.intf_name, dev, sizeof(inter->if_ent.intf_name));
+
+	/* mitigate slash paths in OS that provide   */
+	/* network devices in subdirectories of /dev */
+	iface = strrchr(dev, '/');
+	if (iface)
+		iface += sizeof(char);
+	else
+		iface = dev;
+
+	strlcpy(inter->if_ent.intf_name, iface, sizeof(inter->if_ent.intf_name));
 	
 	if (intf_get(intf, &inter->if_ent) < 0)
 		err(1, "%s: intf_get", __func__);
 
 	if (inter->if_ent.intf_addr.addr_type != ADDR_TYPE_IP)
 		errx(1, "%s: bad interface configuration: %s is not IP",
-		    __func__, dev);
+		    __func__, iface);
 
 	return (inter);
 }
@@ -244,7 +254,7 @@
 }
 
 void
-interface_ether_filter(struct interface *inter,
+interface_ether_filter(char *dev, struct interface *inter,
     int naddresses, char **addresses)
 {
 	char line[48];
@@ -259,7 +269,7 @@
 	    sizeof(inter->if_filter))
 		errx(1, "%s: pcap filter exceeds maximum length", __func__);
 
-	inter->if_eth = eth_open(inter->if_ent.intf_name);
+	inter->if_eth = eth_open(dev);
 	if (inter->if_eth == NULL)
 		errx(1, "%s: eth_open: %s", inter->if_ent.intf_name);
 
@@ -307,7 +317,7 @@
 		 * ignore our own packets.
 		 */
 		if (inter->if_ent.intf_link_addr.addr_type == ADDR_TYPE_ETH) {
-			interface_ether_filter(inter, naddresses, addresses);
+			interface_ether_filter(dev, inter, naddresses, addresses);
 
 			/* 
 			 * We open all interfaces before parsing the
