From owner-freebsd-questions Sun Jul 16 4: 1:51 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by hub.freebsd.org (Postfix) with ESMTP id F03C237B742 for ; Sun, 16 Jul 2000 04:01:43 -0700 (PDT) (envelope-from Jan.Grant@bristol.ac.uk) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Sun, 16 Jul 2000 12:01:15 +0100 Received: from localhost (cmjg@localhost) by mail.ilrt.bris.ac.uk (8.8.7/8.8.8) with ESMTP id MAA00676; Sun, 16 Jul 2000 12:01:14 +0100 (BST) Date: Sun, 16 Jul 2000 12:01:14 +0100 (BST) From: Jan Grant To: nimrodm@email.com Cc: freebsd-questions@freebsd.org Subject: Re: DIVERT sockets In-Reply-To: <20000715184427.A1771@localhost.bsd.net.il> 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, 15 Jul 2000, Nimrod Mesika wrote: > In my program I use the following code (taken from natd) to receive the > packets: > > divertInOut = socket (PF_INET, SOCK_RAW, IPPROTO_DIVERT); > addr.sin_family = AF_INET; > addr.sin_addr.s_addr= INADDR_ANY; > addr.sin_port = DIVERT_PORT; I don't know what DIVERT_PORT is defined as, but you may need htons(DIVERT_PORT) (and strictly speaking, htonl(INADDR_ANY) if memory serves) - have you checked what socket the process appears to be listening on when it runs? -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287163 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk Goedel would be proud - I'm both inconsistent _and_ incomplete. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message