Commit graph

22 commits

Author SHA1 Message Date
H. Peter Anvin
cb619257ed recvfrom: update config.h define for in_pktinfo.ipi_addr
configure.ac now explicitly checks for struct in_pktinfo.ipi_addr;
update the configure name to match.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-06-10 18:38:43 -07:00
H. Peter Anvin
fefaa2cc5c autoconf: modernize and modularize
Use my modular m4 library used for other things as well; update
autoconf macros to 2.71 standard.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-06-10 18:24:53 -07:00
H. Peter Anvin
b2b34cecc8 tftpd: Canonicalize myaddr before address_is_local()
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>
2015-08-07 11:55:08 -07:00
H. Peter Anvin
7678ae7f14 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>
2015-08-07 11:49:13 -07:00
H. Peter Anvin
c89a63a441 tftp: convert IPv6-mapped IPv4 addresses to IPv4
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>
2014-06-07 12:37:33 -07:00
H. Peter Anvin
128e6a3905 Support IPv6 on MacOS X systems
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>
2012-03-01 22:44:32 -08:00
H. Peter Anvin
c6d2c36b1a tftpd: the "is this address local" algorithm no longer works on Linux
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>
2011-12-08 21:48:06 -08:00
H. Peter Anvin
a63534e6e6 recvfrom: fix the type of the fallthrough case
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>
2009-12-11 16:07:10 -08:00
Karsten Keil
28f22b6591 Add support for IPv6 in the server and client.
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>
2008-07-23 14:29:41 -04:00
H. Peter Anvin
22accddda0 Reformat the source code
The source code was a mix of different styles; normalize on NASM
style; basically K&R style with 4 space indentation.
2008-07-08 17:14:44 -04:00
H. Peter Anvin
14993bc916 Introduce socklen_t; detect non-local (e.g. broadcast) receive addresses 2006-10-04 21:54:04 -07:00
H. Peter Anvin
40133b212b Move common code to a common/ subdirectory 2006-10-04 10:19:06 -07:00
H. Peter Anvin
5336233982 Spell IP_RECVDSTADDR correctly 2006-02-16 08:17:59 -08:00
hpa
0f52cd8fa4 More error message improvements; work around a suspect Solaris compiler bug 2002-11-09 02:22:59 +00:00
hpa
9570005ba2 Yet more portability hacks. 2001-11-12 21:44:05 +00:00
hpa
2c31169f57 Major overhaul of the portability stuff; port to autoconf 2.52 2001-11-12 10:03:04 +00:00
hpa
3df5c1f25c Even more portability work... 2001-11-12 06:46:56 +00:00
hpa
5ed924bce2 Solaris need #define _XPG4_2 for recvmsg() 2001-08-03 04:03:40 +00:00
hpa
266427bc5b Portability improvements. Now compiles and works on Solaris 8, as well
as Linux.
2001-08-03 03:17:57 +00:00
hpa
849efd27b3 *** empty log message *** 2001-04-23 19:59:47 +00:00
hpa
c92bf0f3d4 More merging mania... 2001-03-30 01:30:49 +00:00
hpa
ffa45eae76 Add code to always reply using the queried IP address, if the OS
makes it possible.
2001-03-28 18:24:25 +00:00