Commit graph

14 commits

Author SHA1 Message Date
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
33051a296c signals: require and always use sigaction()
tftpd already requires sigaction() to compile, so there is no reason
to use anything else. It also allows for nicer combination of flags.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-06-10 14:36:28 -07:00
H. Peter Anvin
1f4b33a1f7 Modernize: use sigaction() whenever possible. Remove uses of common.
bsd_signal() may not be defined, and there is really no reason to even
try to use it if sigaction() is avaiable; using sigaction() guarantees
the semantics we really want.

Replace uses of common variables with explicit instantiation and
extern declarations in a header file.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-05-29 15:34:57 -07:00
Sridhar Samudrala
740871b0f5 Fix numeric IPv6 address handling
The following patch sets additional hints to restrict the addresses
returned by getaddrinfo() to specify preferred socket type, protocol
and a flag to return only v4/v6 addresses based on the configured
addresses.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-08-09 20:58:19 -07:00
Karsten Keil
18fd18bd5c Improve address type error handling
This patch detects numeric address types to avoid unnecessary
warnings/errors.  It also cleans up error printing to not print error
messages on stderr in the deamon case.

Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-31 11:48:18 -07:00
H. Peter Anvin
77fbfeebee Implement is_numeric_ipv6() as a state machine
Implement is_numeric_ipv6() as a state machine, so we can avoid
in-place modification.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-30 16:34:44 -07:00
Karsten Keil
cfb85d4dec Fix numeric IPv6 address handling
This patch fix a issue with numeric IPv6 addresses in the
tftpd -a address[:port] option.

Since IPv6 addresses use colon ':' in differnt counts itself, we cannot detect,
if the last colon is a seperator, so it is needed to put the IPv6 address into
square brackets, e.g. [2001:db8::1], so a optional port assignment is
unambiguous.
The patch also allows to specify numeric IPv6 addresses in other places enclosed
in [], but in these cases it accept these also without [].

Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-30 15:20:31 -07: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
50f22a7ad2 Remove long since obsolete ID tags 2008-07-08 17:30:27 -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
d15a61abe6 Prototype cleanup; use "config.h" where appropriate 2007-01-15 01:20:41 -08:00
Zack Bartel
ec5973ac5f Moved pick_port_bind() to the libcommon common code so both client and server can use it. Client can now specify a range of ephemeral ports (transaction id) 2006-11-13 17:33:29 -08: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