From owner-freebsd-hackers Mon Dec 8 04:34:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA02595 for hackers-outgoing; Mon, 8 Dec 1997 04:34:03 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from relay.ucb.crimea.ua (relay.ucb.crimea.ua [194.93.177.113]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id EAA02534 for ; Mon, 8 Dec 1997 04:32:28 -0800 (PST) (envelope-from ru@relay.ucb.crimea.ua) Received: (from ru@localhost) by relay.ucb.crimea.ua (8.8.8/8.8.8) id OAA07525 for hackers@freebsd.org; Mon, 8 Dec 1997 14:31:33 +0200 (EET) (envelope-from ru) From: Ruslan Ermilov Message-Id: <199712081231.OAA07525@relay.ucb.crimea.ua> Subject: help: divert sockets question To: hackers@freebsd.org Date: Mon, 8 Dec 1997 14:31:33 +0200 (EET) X-My-Interests: Unix,Oracle,Networking X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, Hackers! I'm in process of writing a small `iptunnel' program which lets me tunnel IP traffic thru UDP. My program uses two sockets: UDP and divert. It reads IP-packet from divert socket and sends it to the remote machine thru UDP. Remote machine then reads it from UDP and reinjects the IP-packet by writing it to the divert socket. And vice versa. It works greatly! Problem: I want to reinject received thru UDP IP-packet as incoming. `man ipdivert' says that I should use sendto() syscall with a destination address equal to IP address of some my local interface. I did it and it doesn't works. It seems to me like a kernel is just dropping such a packet. But no error returned from sendto(), no packets travel thru the firewall. Can anyone point me a way to write packet as incoming? Should I change some IP-packet fields? TIA, -- Ruslan A. Ermilov System Administrator ru@ucb.crimea.ua United Commercial Bank +380-652-247647 Simferopol, Crimea 2426679 ICQ Network, UIN