From owner-freebsd-stable@FreeBSD.ORG Tue Mar 9 10:48:08 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF84116A4CE for ; Tue, 9 Mar 2004 10:48:08 -0800 (PST) Received: from cheer.mahoroba.org (flets20-024.kamome.or.jp [218.45.20.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6219943D3F for ; Tue, 9 Mar 2004 10:48:08 -0800 (PST) (envelope-from ume@FreeBSD.org) Received: from lyrics.mahoroba.org (IDENT:3kASvVwgi+yEMbPJ6LDiFZUAVJjMiEwoetRC8lilX2pgk7fe4u+DAgvtgDcBVHUQ@lyrics.mahoroba.org [IPv6:3ffe:501:185b:8010:280:88ff:fe03:4841]) (user=ume mech=CRAM-MD5 bits=0)i29Im2YM099735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Mar 2004 03:48:02 +0900 (JST) (envelope-from ume@FreeBSD.org) Date: Wed, 10 Mar 2004 03:48:02 +0900 Message-ID: From: Hajimu UMEMOTO To: Lukasz Stelmach In-Reply-To: <20040309182857.GA818@tygrys.k.telmark.waw.pl> References: <20040309182857.GA818@tygrys.k.telmark.waw.pl> User-Agent: xcite1.38> Wanderlust/2.11.3 (Wonderwall) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386--freebsd) MULE/5.0 (=?ISO-2022-JP?B?GyRCOC1MWhsoQg==?=) X-Operating-System: FreeBSD 5.2-CURRENT MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on cheer.mahoroba.org cc: freebsd-stable@freebsd.org Subject: Re: sockaddr_(in|in6) compatiblity X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2004 18:48:09 -0000 Hi, >>>>> On Tue, 9 Mar 2004 19:28:57 +0100 >>>>> Lukasz Stelmach said: Lukasz> 1. I open socket AF_INET6/SOCK_DGRAM... OK Lukasz> 2. bind it to ::ffff:127.0.0.1/53... OK Why do you use IPv4-mapped IPv6 address for binding IPv4? When you wish to bind to IPv4, just use AF_INET socket. This feature is disabled by default on 5-CURRENT. Lukasz> 3. recvfrom() data from the socket... OK Lukasz> 4. *from (the 5th parameter to recvfrom) gets filled in like it was Lukasz> a sockaddr_in (ipv4) structure which means that senders address Lukasz> is in sin6_flowinfo instead of sin6_addr. Now this makes somehow Lukasz> more difficult to use inet_ntop since first one has to check sin6_family Lukasz> and decide wether to pass sin6_addr or sin6_flowinfo as an address Lukasz> to print. Use getnameinfo(3). You shouldn't need to use inet_ntop(3). Welcome to an address family independent programming with getaddrinfo(3) and getnameinfo(3). Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/