diff -u orig/main.c mod/main.c
--- orig/main.c	Sun Sep 28 17:43:32 2003
+++ mod/main.c	Sun May 31 16:49:39 2009
@@ -49,11 +49,12 @@
 #include <string.h>
 #include <arpa/inet.h>
 #include <stdio.h>
-#include <linux/if.h>
+#include <net/if.h>
 #include <sys/ioctl.h>
 
 main(int argc,char **argv)
 {
+
 	/* Debugging, forking, other settings */
 	int debug, forking;
 	
@@ -193,7 +194,7 @@
 		}
 		
 		/* Save the index for later use */	
-		ifs[maxifs].ifindex = reqbuf.ifr_ifindex;
+		ifs[maxifs].ifindex = reqbuf.ifr_index;
 		
 		/* Request flags for this interface */
 		if (ioctl(fd,SIOCGIFFLAGS, &reqbuf) < 0) {
@@ -251,12 +252,12 @@
 		perror("SO_BROADCAST on rcv");
 		exit(1);
 	};
-	if(setsockopt(rcv, SOL_IP, IP_RECVTTL, (char*) &x, sizeof(int))<0){
+	if(setsockopt(rcv, IPPROTO_IP, IP_RECVTTL, (char*) &x, sizeof(int))<0){
 		perror("IP_RECVTTL on rcv");
 		exit(1);
 	};
-	if(setsockopt(rcv, SOL_IP, IP_PKTINFO, (char*) &x, sizeof(int))<0){
-		perror("IP_PKTINFO on rcv");
+	if(setsockopt(rcv, IPPROTO_IP, IP_SENDSRCADDR, (char*) &x, sizeof(int))<0){
+		perror("IP_SENDSRCADDR on rcv");
 		exit(1);
 	};
 
@@ -323,29 +324,30 @@
 		ttlptr=NULL;
 		if (rcv_msg.msg_controllen>0)
 		  for (cmsg=CMSG_FIRSTHDR(&rcv_msg);cmsg;cmsg=CMSG_NXTHDR(&rcv_msg,cmsg)) {
-		    if (cmsg->cmsg_type==IP_TTL) {
+		    if (cmsg->cmsg_type==IP_RECVTTL) {
 		      ttlptr = (int *)CMSG_DATA(cmsg);
 		    }
-		    if (cmsg->cmsg_type==IP_PKTINFO) {
-		      rcv_ifindex=((struct in_pktinfo *)CMSG_DATA(cmsg))->ipi_ifindex;
-		    }
+		      
+		    // interface index :-(
 		  }
 
 		if (ttlptr == NULL) {
 			perror("TTL not found on incoming packet\n");
-			exit(1);
+			//exit(1);
+			continue;
 		}
 		if (*ttlptr == ttl) {
-			DPRINT ("Got local packge (TTL %i) on interface %i\n",*ttlptr,rcv_ifindex);
+			DPRINT ("Got local package (TTL %i) on interface %i\n",*ttlptr,rcv_ifindex);
 			continue;
 		}
 		
 
 		gram[HEADER_LEN + len] =0;
 		DPRINT("Got remote package:\n");
-		// DPRINT("Content:\t%s\n",gram+HEADER_LEN);
+		DPRINT("Content:\t%s\n",gram+HEADER_LEN);
 		DPRINT("TTL:\t\t%i\n",*ttlptr);
-		DPRINT("Interface:\t%i\n",rcv_ifindex);
+		DPRINT("Length:\t\t%i\n",len);
+		//DPRINT("Interface:\t%i\n",rcv_ifindex);
 		DPRINT("From:\t\t%s:%d\n",inet_ntoa(rcv_addr.sin_addr),rcv_addr.sin_port);
 	
 		/* copy sender's details into our datagram as the source addr */	
@@ -359,19 +361,22 @@
 		/* Iterate through our interfaces and send packet to each one */
 		for (x=0;x<=maxifs;x++)
 		{
-			if (ifs[x].ifindex == rcv_ifindex) continue; /* no bounces, please */
+		//	if (ifs[x].ifindex == rcv_ifindex) continue; /* no bounces, please */
 
 			/* Set destination addr ip - port is set already*/
-			bcopy(&(ifs[x].dstaddr.sin_addr.s_addr),(gram+16),4);	
+			bcopy(&(ifs[x].dstaddr.sin_addr.s_addr),(gram+16),4);
+			
+			ifs[x].dstaddr.sin_port=htons(port);
+				
 
 			DPRINT ("Sent to %s:%d on interface %i\n",
 				inet_ntoa(ifs[x].dstaddr.sin_addr), /* dst ip */
-				ntohs(*(u_short*)(gram+22)), /* dst port */
+				htons(*(u_short*)(gram+22)), /* dst port */
 				ifs[x].ifindex); /* interface number */
 				
 			/* Send the packet */
 			if (sendto(fd,
-					&gram,
+					(void *)&gram,
 					28+len,0,
 					(struct sockaddr*)&ifs[x].dstaddr,sizeof(struct sockaddr)
 				) < 0)

