--- acp.c.orig	2005-10-28 12:18:03.000000000 -0500
+++ acp.c	2011-05-22 18:27:33.000000000 -0500
@@ -29,7 +29,7 @@
 
 #include <ctype.h>
 #include <signal.h>
-#include <wait.h>
+#include <sys/wait.h>
 #include <errno.h>
 #include <time.h>
 
--- procinfo.c.orig	2006-01-07 08:03:13.000000000 -0600
+++ procinfo.c	2011-05-22 18:27:33.000000000 -0500
@@ -29,7 +29,7 @@
 
 #include <ctype.h>
 #include <signal.h>
-#include <wait.h>
+#include <sys/wait.h>
 #include <errno.h>
 #include <time.h>
 
--- tcpproxy.c.orig	2007-08-30 04:36:12.000000000 -0500
+++ tcpproxy.c	2011-05-22 18:27:33.000000000 -0500
@@ -29,7 +29,7 @@
 
 #include <ctype.h>
 #include <signal.h>
-#include <wait.h>
+#include <sys/wait.h>
 #include <errno.h>
 #include <time.h>
 
@@ -45,7 +45,6 @@
 #include <syslog.h>
 #include <sys/time.h>
 
-#include <linux/netfilter_ipv4.h>
 
 
 
@@ -677,7 +676,7 @@
 	if (*configfile != 0)
 		read_configuration(config, configfile);
  	else if (bound == 0  &&  k >= argc) {
-		copy_string(configfile, "/etc/tcpproxy.conf", sizeof(configfile));
+		copy_string(configfile, CONFFILE, sizeof(configfile));
 
 		/* This default is the most common cause for tcpproxy installations
 		 * to fail initially.
@@ -1012,15 +1011,18 @@
 
 
 	if (x->redirmode != 0) {
-		int	rc;
+		//int	rc;
 		size_t	socksize;
 		struct sockaddr_in sock;
 
 		socksize = sizeof(sock);
+#if 0
 		rc = getsockopt(0, SOL_IP, SO_ORIGINAL_DST, &sock, &socksize);
 		if (rc != 0)
 			;
-		else if (strcmp((char *) inet_ntoa(sock.sin_addr), x->sock.ipnum) != 0  ||
+		else 
+#endif
+		if (strcmp((char *) inet_ntoa(sock.sin_addr), x->sock.ipnum) != 0  ||
 			 ntohs(sock.sin_port) != x->sock.port) {
 
 			/*
--- tcpproxy.h.orig	2006-08-28 13:20:46.000000000 -0500
+++ tcpproxy.h	2011-05-22 18:27:33.000000000 -0500
@@ -7,8 +7,9 @@
 
 
 #define	PROXYNAME		"tcpproxy"
-#define PIDFILE                 "/var/run/tcpproxy.pid"
-#define ERROR_LOG               "/tmp/tcpproxy-error.log"
+#define CONFFILE                "__PREFIX__/etc/tcpproxy.conf"
+#define PIDFILE                 "__PREFIX__/var/run/tcpproxy.pid"
+#define ERROR_LOG               "__PREFIX__/var/log/tcpproxy-error.log"
 #define MAX_PORT                80