The comparisons for forbidden addresses in address_is_local() only
work on canonicalized addresses.
Also, work in the case myaddr is NULL (if we ever call it that way...)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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>
If we receive IPv4 addresses mapped to IPv6, convert them back to IPv4
so that mapping scripts which use \i behave sanely.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add feature test macros for MacOS X, and don't require
IPV6_RECVPKTINFO to exist.
Reported-by: YJZ <vollkommen@gmx.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Linux no longer tries to match the local address with the remote one,
so address_is_local() fails. Try instead to simply see if we can bind
to the explicit address.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If we can't figure out the source address, we have the "fall on our
face" version of myrecvfrom(); make sure its prototype matches. This
handles building on machines where sockaddr_t != int and yet there is
no way to get the source address. This apparently affects at least
one version of Solaris.
Reported-by: Georg Schwarz <georg.schwarz@freenet.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add support for IPv6 in the server and client.
You can force the use of IPv4 or IPv6 only with new
-4 and -6 commandline options, if IPv6 support was compiled in.
Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>