Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/ipf make this program actually work.



details:   https://anonhg.NetBSD.org/src/rev/175c69dd51f0
branches:  trunk
changeset: 510848:175c69dd51f0
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jun 07 14:15:39 2001 +0000

description:
make this program actually work.

diffstat:

 dist/ipf/relay.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 33c0b09c3004 -r 175c69dd51f0 dist/ipf/relay.c
--- a/dist/ipf/relay.c  Thu Jun 07 13:58:23 2001 +0000
+++ b/dist/ipf/relay.c  Thu Jun 07 14:15:39 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: relay.c,v 1.2 2000/05/03 11:40:17 veego Exp $  */
+/*     $NetBSD: relay.c,v 1.3 2001/06/07 14:15:39 mrg Exp $    */
 
 /*
  * Sample program to be used as a transparent proxy.
@@ -109,7 +109,7 @@
        int     fd, sl = sizeof(sl), se;
 
        openlog(argv[0], LOG_PID|LOG_NDELAY, LOG_DAEMON);
-       if ((fd = open("/dev/ipl", O_RDONLY)) == -1) {
+       if ((fd = open("/dev/ipnat", O_RDONLY)) == -1) {
                se = errno;
                perror("open");
                errno = se;
@@ -117,6 +117,9 @@
                exit(-1);
        }
 
+       bzero(&nl, sizeof(nl);
+       nl.nl_flags = IPN_TCP;
+
        bzero(&sin, sizeof(sin));
        sin.sin_family = AF_INET;
        sl = sizeof(sin);
@@ -153,8 +156,8 @@
                exit(-1);
        }
 
-       sin.sin_port = nl.nl_inport;
-       sin.sin_addr = nl.nl_inip;
+       sin.sin_port = nl.nl_realport;
+       sin.sin_addr = nl.nl_realip;
        sl = sizeof(sin);
 
        fd = socket(AF_INET, SOCK_STREAM, 0);



Home | Main Index | Thread Index | Old Index