Opened 14 years ago
Last modified 14 years ago
#1930 new defect
[PATCH] IPv6 Link-local addresses not working
Reported by: | Owned by: | reimar | |
---|---|---|---|
Priority: | normal | Component: | streaming |
Version: | HEAD | Severity: | minor |
Keywords: | Cc: | compn, fcr@… | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
When I try to connect to my local web server (on the same subnet), using link-local addresses, this should work, but it doesn't:
mplayer 'http://[fe80::250:8bff:fedb:54cd%wlan0]/'
It fails with messages like: "Couldn't resolve name for AF_INET6: fe80::250:8bff:fedb:54cd%wlan0".
The reason why it fails, is because it uses things like:
case AF_INET6: our_s_addr = (void *) &server_address.six.sin6_addr; break;
and gethostbyname2 (which is deprecated in favour of getaddrinfo)
The fix is simple: changing the gethostbyname* stuff of connect2Server_with_af (stream/tcp.c) to a more simple function using getaddrinfo, which handles link-local addresses successfully.
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | tcp-getaddrinfo.patch added |
---|
comment:1 by , 14 years ago
This may not be the best patch in the world, but at least it fixes this bug. It also checks the available DNS records (as returned from the resolver) until one of them works.
IMHO, the header should change a bit so that it receives the port as a string, not as an int, and gets resolved on the same call to getaddrinfo.
It was only tested on debian/sid (on x86) as I don't have access to other machines nor operating systems.
Microsoft's winsock specification says that they support getaddrinfo from windows 2000, so I believe that should be no problem. However I couldn't test this code on windows.
comment:2 by , 14 years ago
Cc: | added |
---|
comment:3 by , 14 years ago
Cc: | added |
---|---|
Summary: | IPv6 Link-local addresses not working → [PATCH] IPv6 Link-local addresses not working |
could you post this to the mplayer-dev-eng mailing list by chance? :)
Patch fixing link-local IPv6 support