Greetings All. Tell me please is it normal what i get? 1. I open socket AF_INET6/SOCK_DGRAM... OK 2. bind it to ::ffff:127.0.0.1/53... OK 3. recvfrom() data from the socket... OK 4. *from (the 5th parameter to recvfrom) gets filled in like it was a sockaddr_in (ipv4) structure which means that senders address is in sin6_flowinfo instead of sin6_addr. Now this makes somehow more difficult to use inet_ntop since first one has to check sin6_family and decide wether to pass sin6_addr or sin6_flowinfo as an address to print. Did I miss something in manual? Cheers. PS. I use 4.9-RC from begining of October. -- |/ |_, _ .- --, Ju? z ka?dej strony pe?zn?, potworne ??dze |__ |_|. | \ |_|. ._' /_. B?d? uprawia? nierz?d, za pieni?ze ----- End forwarded message ----- -- |/ |_, _ .- --, Ju? z ka?dej strony pe?zn?, potworne ??dze |__ |_|. | \ |_|. ._' /_. B?d? uprawia? nierz?d, za pieni?ze -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20040309/3422e344/attachment.bin
Lukasz Stelmach <Lukasz.Stelmach@telmark.waw.pl> writes:> 1. I open socket AF_INET6/SOCK_DGRAM... OK > 2. bind it to ::ffff:127.0.0.1/53... OKshouldn't this be ::1? ::ffff:127.0.0.1 is a tunneled IPv4 address, which might explain why you get an IPv4 peer address back. DES -- Dag-Erling Sm?rgrav - des@des.no
Hi,>>>>> On Tue, 9 Mar 2004 19:28:57 +0100 >>>>> Lukasz Stelmach <Lukasz.Stelmach@telmark.waw.pl> 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/