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>
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>
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>
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>
I have encountered a situation where I would like to use tftp-hpa to
retrieve a file that resides within an absolute path containing a ':'
character. Ala, "tftp foobar -c get C:2/tftpdir/myfile". Since the
tftp client automatically converts the host:file syntax, I get an
error "tftp: C: Unknown host".
I made a chage to the tftp client code to add a literal mode (-l),
that prevents the special treatment of the ':' character. I've
attached a patch set for main.c and tftp.1.in for your consideration.
I'm not sure how many folks run into this, but it may be somewhat
common for VxWorks and perhaps MSDOS users.
Thanks,
Craig Johnston
Don't rely on nonstandard bsd_signal() function, instead
require that the platform has sigaction(). This is 2001,
after all. This may resolve some potential portability
problems.
Log a message if memory allocation fails, instead of dying silently.
Clean up the main dispatch loop.
Use <sysexits.h> for exit codes, if it exists.
Reformat tftpd.c to match the other files.