Commit graph

292 commits

Author SHA1 Message Date
H. Peter Anvin
b9708e2201 Update version for release 5.2 2011-12-11 14:13:52 -08:00
H. Peter Anvin
f08a34ede1 CHANGES: document is address local fix
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-12-11 14:13:13 -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
badf05140d spec: BuildPreReq -> BuildRequires; need -devel package
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-06-22 16:32:56 -07:00
H. Peter Anvin
f6a1282fec Update version for release 5.1 2011-06-22 16:29:59 -07:00
H. Peter Anvin
464be3090b tftpd: add Intel copyright header
Part of my Intel job now...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-06-22 16:28:38 -07:00
H. Peter Anvin
bd250a597f CHANGES: Document bug fix
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-06-22 16:27:48 -07:00
H. Peter Anvin
f3035c45bc tftpd: simplify option parsing
Simplify the option parsing to make use of the fact that all the
options we support are integer options.  This fixes a buffer overflow
in the utimeout option.

Reported-by: Timo Warns <warns@pre-sense.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-06-10 11:49:00 -07:00
H. Peter Anvin
2864d83fea tftpd: try to handle duplicate WRQ packets
Duplicate WRQ packets can really hurt, since they end up accessing the
same file.  This attempts to lock the file, which should work for the
case where a correctly implemented TFTP stack uses the same session ID
(port number) for each retry; in any other case they look like
multiple sessions to the same file and it is a crapshoot if we end up
with the correct one.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-05-12 19:16:17 -07:00
H. Peter Anvin
05ffcecaa8 Merge remote-tracking branch 'origin/master' 2011-05-09 21:09:18 -07:00
H. Peter Anvin
ad5aab9281 tftpd: constipate struct formats
struct formats should be static const; make it so and mark all users
const.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-05-05 10:11:59 -07:00
H. Peter Anvin
0b5732e263 remap: change the mode argument from a boolean to a character
Instead of taking a boolean value for get/put, pass a character; this
allows us to extend the number of possibilities in the future.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-05-05 10:08:53 -07:00
H. Peter Anvin
915f62f5c7 CHANGES: document wraparound fix 2010-09-20 17:49:10 -07:00
Tim Newsome
aeb1c31bae tftpd: Don't resend the OACK packet on block number wrap
When uploading a file that is larger than 32MB (with standard block
size), the block number will roll over. If it rolls over to 0, the code
mistakenly resends the option ack frame instead of acknowledging the 0
data block. This change fixes that behavior.
2010-09-20 17:48:33 -07: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
H. Peter Anvin
e7a7b19483 Update CHANGES for future 5.1 release
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-09-14 14:46:34 -07:00
H. Peter Anvin
ab382980ae Fix man page formatting 2009-09-14 14:44:54 -07:00
Ferenc Wagner
c86f82532e Implement the --pidfile option
Setting the umask moved later, right before entering the select loop,
so that it does not affect the permissions of the pid file.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-09-14 14:41:13 -07:00
Ferenc Wagner
5a27e30ec2 Untabify tftpd.c
Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-09-14 14:41:10 -07:00
Ferenc Wagner
85029077c8 Fix comment typo
Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-09-14 14:41:07 -07:00
Ferenc Wagner
3f2bc9833d Ensure that the log socket is available for the child
Just in case syslog has been restarted, bounce the log socket before
the chroot.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-09-14 14:41:02 -07:00
Ferenc Wagner
44c98cf8b6 Downcase datarootdir, so mandir et al. find their defaults
mandir et all uses $(datarootdir), not $(DATAROOTDIR)

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-09-14 14:40:17 -07:00
H. Peter Anvin
338648870e tftpd.8: we're no longer limited to IPv4 2009-02-24 16:27:27 -08:00
H. Peter Anvin
9ba4e118d2 tftpd.c: update copyright notice 2009-02-24 16:26:16 -08:00
H. Peter Anvin
2f3a775f85 autogen.sh: just do "make autoconf"
We require GNU make, so we can have autoconf built from inside the
Makefile.  Just make autogen.sh do "make autoconf" for convenience.
2009-02-16 14:53:50 -08:00
H. Peter Anvin
e7a5fc2d68 Update CHANGES for 5.0 release 2009-02-16 14:51:22 -08:00
H. Peter Anvin
878b024bcd Update version for release 5.0 2009-02-16 14:49:43 -08:00
Florian Lohoff
acf818880c tftpd: correctly disable PMTU discovery in standalone mode
Use the correct file descriptors so we correctly turn off PMTU.
2009-02-16 14:40:01 -08:00
H. Peter Anvin
932277c9a5 tftpd: implement the "rollover" option
Implement the "rollover" option, to set the rollover block number to
anything other than zero.  Apparently some idiots have gotten the idea
that block numbers should roll over to one, rather than zero.
2009-02-02 15:14:27 -08:00
H. Peter Anvin
fcdd859a75 autogen.sh: script to run relevant autotools 2009-02-02 15:14:05 -08:00
Georg Schwarz
b0a2a17864 Cast IPv6 address from SOCKADDR_P() to struct in6_addr *
We need to cast IPv6 addresses from SOCKADDR_P() to struct in6_addr *
on some platforms, including at least MacOS X.
2008-11-14 08:37:49 -08:00
H. Peter Anvin
12996491c2 Document getaddrinfo() workaround. 2008-11-14 08:32:29 -08:00
H. Peter Anvin
dd50e8b75c If AI_CANONNAME or AI_ADDRCONFIG don't exist, set them to zero
If the AI_CANONNAME or AI_ADDRCONFIG flags are missing, just set them
to zero.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-14 08:31:03 -08:00
H. Peter Anvin
920b99dfee Update version for release 0.49 2008-10-20 15:08:31 -07:00
H. Peter Anvin
4f715da294 Update CHANGES 2008-10-20 15:07:59 -07:00
Роман Донченко
ac5f0ab996 Compilation of tftp-hpa's Git HEAD with no IPv6, and misc
This patch does two things:
a) makes tftp-hpa to compile on systems with no IPv6 support (there were
some IPv6 macros used unconditionally);
b) removes a stray binary character, which was annoying.
2008-10-20 15:06:24 -07:00
H. Peter Anvin
a1dfd6baf8 Support editline instead of readline
Support editline as an alternative to readline.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-08-09 21:14:45 -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
544abd789e Add error messages if address types mismatch
If a user does supply a IPv4 or IPv6 address
but force the other type with -4 or -6, give an error.
The patch also fix the special [::ffff:127.0.1]
address handling, it work now if you bind to this
address but only if you not force IPv6 only, it seems
that the kernel does not signal connections to a
IPv6 socket listen on [::ffff:127.0.0.1], if it was bound
IPv6 only.
I think we can live with it and do not need a special test
for this address.

Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-08-01 08:24:16 -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
bdb90cf176 Add .gitignore file
Add .gitignore file so "git status" is actually useful.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-30 17:18:17 -07:00
H. Peter Anvin
e4d3083006 tftpd: switch to getopt_long()
Switch to using getopt_long(); include a version in case the platform
lacks it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-30 17:16:00 -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
H. Peter Anvin
0c6f7f86d3 tftpd: mark symbols static
Mark symbols not accessed from other files static.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-30 16:17:02 -07:00
H. Peter Anvin
7670c83e5a release.sh: remove Cogito
Remove Cogito use in favour of plain git; make sure the index is
clean.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-30 15:36:46 -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
H. Peter Anvin
c3a5c712e2 Allow the -4 option even in an IPv4-only configuration
Allow the -4 option even if IPv6 isn't compiled in.
2008-07-23 14:36:18 -04:00
H. Peter Anvin
4bdac0b536 Document changes for 0.49 2008-07-23 14:31:48 -04: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
Karsten Keil
7fe0fb941c IPv6 infrastructure support
Add autoconf rules to detect IPv6 availability and some of the neeeded
support functions. Add stubs for getaddrinfo and inet_ntop.
You can disable IPv6 at compile time with
./configure --without-ipv6

Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-23 14:24:19 -04:00