Date: Tue, 16 May 2006 21:13:32 +0900 From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= <jinmei@isl.rdc.toshiba.co.jp> To: Hideki Yamamoto <yamamoto436@oki.com> Cc: freebsd-net@freebsd.org, freebsd-pf@freebsd.org Subject: Re: IPv6 raw socket to send original udp Message-ID: <y7v64k6qiab.wl%jinmei@isl.rdc.toshiba.co.jp> In-Reply-To: <20060508.054451.41688849.yamamoto436@oki.com> References: <20060508.054451.41688849.yamamoto436@oki.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> On Mon, 08 May 2006 05:44:51 +0900 (JST), >>>>> Hideki Yamamoto <yamamoto436@oki.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?y7v64k6qiab.wl%jinmei>