masneyb / gftp

gFTP is a free multithreaded file transfer client for *NIX based machines. 56 language translations available.
http://www.gftp.org
MIT License
116 stars 21 forks source link

IPv6 support is broken #140

Closed wdlkmpx closed 2 years ago

wdlkmpx commented 2 years ago

Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685910 Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686270

There are 2 patches https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=685910;filename=gftp-ipv6-dataconn.patch;msg=5 https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=686270;filename=gftp-ipv6-dataconn2.patch;msg=5

Both patches have been partially applied (one way or another), but it's obviously broken because of this line in socket-connect.c

memcpy (request->remote_addr, &((struct sockaddr_in *) current_hostp->ai_addr)->sin_addr,  request->remote_addr_len);

There's no logic to copy sin6_addr if protocol is AF_INET6. This is easy to fix, but how to test it

wdlkmpx commented 2 years ago

Confirming, it's broken, fixes will follow

wdlkmpx commented 2 years ago

Forgot to add ref

This issue has been fixed by commit https://github.com/masneyb/gftp/commit/373fcb61a6fea7972ab17e3aadd751f74c54a221