tftpd: Canonicalize all the addresses

We cannot canonicalize myaddr and not the from address.  We need to
canonicalize both of them, or else we'll try to create an IPv4 socket
and bind an IPv6-mapped IPv4 address to it, which is going to fail.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2015-08-07 11:49:13 -07:00
parent ff819b108a
commit 7678ae7f14
3 changed files with 25 additions and 26 deletions

View file

@ -19,5 +19,4 @@
int
myrecvfrom(int s, void *buf, int len, unsigned int flags,
struct sockaddr *from, socklen_t *fromlen,
union sock_addr *myaddr);
union sock_addr *from, union sock_addr *myaddr);