From owner-freebsd-stable@FreeBSD.ORG Thu Mar 18 05:05:27 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 17BC316A4CE for ; Thu, 18 Mar 2004 05:05:27 -0800 (PST) Received: from 153-bem-1.acn.waw.pl (153-bem-1.acn.waw.pl [62.121.80.153]) by mx1.FreeBSD.org (Postfix) with SMTP id F062243D2F for ; Thu, 18 Mar 2004 05:05:24 -0800 (PST) (envelope-from lukasz.stelmach@k.telmark.waw.pl) Received: (qmail 21166 invoked by uid 1000); 18 Mar 2004 13:05:23 -0000 Date: Thu, 18 Mar 2004 14:05:23 +0100 From: Lukasz Stelmach To: Hajimu UMEMOTO Message-ID: <20040318130523.GA20949@tygrys.k.telmark.waw.pl> References: <20040309182857.GA818@tygrys.k.telmark.waw.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Mail-Editor: nvi X-GPG-Fingerprint: 68B8 6D4F 0C5E 291F C4E0 BBF4 35DC D8F2 C9BD 2BDC X-GPG-Key: http://www.ee.pw.edu.pl/~stelmacl/gpg_key.txt 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 Reply-To: Lukasz Stelmach List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2004 13:05:27 -0000 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Byla godzina 03:48:02 w Wednesday 10 March, gdy do autobusu wsiadl kanar i wrzasnal:"Hajimu UMEMOTO!!! Bilecik do kontroli!!!" A on(a) na to: LS>> 1. I open socket AF_INET6/SOCK_DGRAM... OK LS>> 2. bind it to ::ffff:127.0.0.1/53... OK HU> Why do you use IPv4-mapped IPv6 address for binding IPv4? When you HU> wish to bind to IPv4, just use AF_INET socket. It is not me in fact who ueses it. I try to setup djbdns with IPv6 support. HU> This feature is disabled by default on 5-CURRENT. Can you tell me (or give some article to read) why? I am curious because i think this is quite good for a programmer to use one type of socket and the same set of structures for both protocols, especially now when IPv6 just starts its go. LS>> 3. recvfrom() data from the socket... OK LS>> 4. *from (the 5th parameter to recvfrom) gets filled in like it was LS>> a sockaddr_in (ipv4) structure [...] HU> Use getnameinfo(3). You shouldn't need to use inet_ntop(3). Welcome HU> to an address family independent programming with getaddrinfo(3) and HU> getnameinfo(3). In fact it is not the matter of inet_ntop(3) but the way the djbdns patch seems to work. get*info(3) won't do the thing since to get the address from sockaddr structure (after recvfrom) i still need to check the family field and do proper cast. IMHO it would be much more logical that if I open AF_INET6 socket (even v4 mapped) i *always* get sockaddr_in6 structure and need not to cast it to sockaddr_in. Best regards, --=20 |/ |_, _ .- --, Ju=BF z ka=BFdej strony pe=B3zn=B1, potworne =BF= =B1dze |__ |_|. | \ |_|. ._' /_. B=EAd=EA uprawia=B3 nierz=B1d, za pieni= =B1ze --8t9RHnE3ZwKMSgU+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQFAWZ6TNdzY8sm9K9wRAv3eAJwLEEfnsUTG09RV0+qhaqXoAmiLdQCffB+a ee5cna/DXhiv5FF9f2v/XcI= =Y8vJ -----END PGP SIGNATURE----- --8t9RHnE3ZwKMSgU+--