From owner-freebsd-questions Tue Oct 6 13:45:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA14040 for freebsd-questions-outgoing; Tue, 6 Oct 1998 13:45:44 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.144.32]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA13997 for ; Tue, 6 Oct 1998 13:45:32 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.8.8/8.8.8) with ESMTP id NAA27771; Tue, 6 Oct 1998 13:45:26 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Date: Tue, 6 Oct 1998 13:45:26 -0700 (PDT) From: Doug White To: "Eric J. Schwertfeger" cc: questions@FreeBSD.ORG Subject: Re: Trying to learn divert sockets In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 3 Oct 1998, Eric J. Schwertfeger wrote: > > I'm trying to write a simple program that uses divert sockets, and it > isn't going too well. > > Basically, I can make my program reinject the packets back into the same > device as they were diverted from, and that works. However, I'm trying to > divert the packets to a different device for various reasons. > > My luck so far doing this has been zero. I've got a subroutine that sets > up sockaddr_in for use, and works well enough that I can bind the local > end of a socket to a specific IP address and port, but when I use the same > routine in my divert code, using the same port number that I'm diverting, > and the IP address of the interface that I want to divert to, I get > EADDRNOTAVAIL. Have you looked at the natd code? natd is the classic divert client. Doug White Internet: dwhite@resnet.uoregon.edu | FreeBSD: The Power to Serve http://gladstone.uoregon.edu/~dwhite | www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message