From owner-freebsd-net@FreeBSD.ORG Tue May 16 12:13:43 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE68816A417; Tue, 16 May 2006 12:13:43 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [202.249.10.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD7D043D5A; Tue, 16 May 2006 12:13:42 +0000 (GMT) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from impact.jinmei.org (unknown [3ffe:501:100f:1010:d435:78f6:660a:b974]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id AF2F61521A; Tue, 16 May 2006 21:13:41 +0900 (JST) Date: Tue, 16 May 2006 21:13:32 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: Hideki Yamamoto In-Reply-To: <20060508.054451.41688849.yamamoto436@oki.com> References: <20060508.054451.41688849.yamamoto436@oki.com> User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.3 Mule/5.0 (SAKAKI) Organization: Research & Development Center, Toshiba Corp., Kawasaki, Japan. MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: freebsd-net@freebsd.org, freebsd-pf@freebsd.org Subject: Re: IPv6 raw socket to send original udp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2006 12:13:47 -0000 >>>>> On Mon, 08 May 2006 05:44:51 +0900 (JST), >>>>> Hideki Yamamoto said: > I wonder if IPv6 raw socket can be used only for ICMPv6. No, you can use any non built-in protocols on an IPv6 raw socket. In fact, IPv6 PIM daemons use IPv6 raw sockets for IPPROTO_PIM. But... > I would like to use IPv6 raw socket for original udp packet. you cannot do this, and, even if it's a PIM packet (for example), I'm afraid the socket does not meet your requirement: you cannot specify an arbitrary source address for the packets, which I guess is one of your goals. With the IPv6 socket API you can only specify a node's own address as the source address of outgoing packets sent from an AF_INET6 socket. This is a deliberate design choice of the API (RFC2292 or RFC3542). I don't know the original intent of IP_HDRINCL, that is, whether it intentionally allows the specification of an arbitrary source address, but at least one clear purpose of this option is to allow the user to specify the value of some specific fields of the IP header. Since RFC3542 (and RFC3493) provide dedicated API knobs for this purpose, however, we don't need to provide an IPv6 version of IP_HDRINCL. So, if a program needs to specify an arbitrary source IPv6 address for outgoing packets, it should use other "packet injection" interface such as BPF. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp