From owner-freebsd-hackers Wed Nov 10 10:37:12 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 9464E15021 for ; Wed, 10 Nov 1999 10:36:58 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id KAA42838; Wed, 10 Nov 1999 10:35:47 -0800 (PST) From: Archie Cobbs Message-Id: <199911101835.KAA42838@bubba.whistle.com> Subject: Re: Problem about Raw IP socket In-Reply-To: from Sunthiti Patchararungruang at "Nov 10, 1999 10:42:42 pm" To: stt@pluto.cpe.ku.ac.th (Sunthiti Patchararungruang) Date: Wed, 10 Nov 1999 10:35:47 -0800 (PST) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sunthiti Patchararungruang writes: > I have to create a route program for my thesis. Its operation is different > from normal packet forwarding. Therefore, I need to forward all packets > instead of using normal packet forwarding in FreeBSD kernel. I capture > packets via Divert socket. It works well. I can grap IP packket including > its header. However, I use normal Raw IP socket to write the packets to > selected next-hop. I use socket option SO_DONTROUTE and IP_HDRINCL with my > Raw IP socket and use "sendto" to write packets with "sockaddr" set to the > IP of the next-hop-gateway. The sendto command always return error with > errno=22. How can I solve this error? 22 = EINVAL. That can happen if your IP header is not well-formed. The relevant file is /usr/src/sys/netinet/raw_ip.c. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message