summaryrefslogtreecommitdiffstats
path: root/usr.bin/tftp/main.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r287320:delphij2015-09-141-4/+3
| | | | | | - uri is expected to be nul-terminated (strchr used later), so use strlcpy instead of strncpy. - replace the other two cases of strncpy+\0 with strlcpy.
* More -Wmissing-variable-declarations fixes.ed2012-10-191-2/+2
| | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
* fgets(3) returns a pointer, so compare against NULL, not integer 0.kevlo2012-01-131-1/+1
|
* Replace index() and rindex() calls with strchr() and strrchr().ed2012-01-031-7/+7
| | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls.
* peeraddr is only used in sizeof() evaluations, so instead of declaring itdelphij2011-07-111-1/+1
| | | | | | a variable, use typedef. MFC after: 1 month
* Remove duplicated header fileskevlo2011-06-241-1/+0
|
* Specify correct RFC2347 for TFTP options in diagnostic message.rodrigc2011-06-161-2/+2
|
* Fix a couple of spelling errors.imp2011-05-311-3/+3
| | | | Submitted by: bcr@
* Remove the advertising clause from UCB copyrighted files in usr.bin. Thisjoel2010-12-111-4/+0
| | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson
* Make WARNS=6 clean.marius2010-09-241-26/+22
| | | | MFC after: 1 week
* Go ahead and merge the work edwin@ on tftpd into the tree. It is aimp2010-05-041-174/+482
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lot better than what's in the tree now. Edwin tested it at a prior employer, but can't test it today. I've found that it works a lot better with the various uboot versions that I've used in my embedded work. Here's the pkg-descr from the port that describes the changes: It all started when we got some new routers, which told me the following when trying to upload configuration or download images from it: The TFTP server doesn't support the blocksize option. My curiousity was triggered, it took me some reading of RFCs and other documentation to find out what was possible and what could be done. Was plain TFTP very simple in its handshake, TFTP with options was kind of messy because of its backwards capability: The first packet returned could either be an acknowledgement of options, or the first data packet. Going through the source code of src/libexec/tftpd and going through the code of src/usr.bin/tftp showed that there was a lot of duplicate code, and the addition of options would only increase the amount of duplicate code. After all, both the client and the server can act as a sender and receiver. At the end, it ended up with a nearly complete rewrite of the tftp client and server. It has been tested against the following TFTP clients and servers: - Itself (yay!) - The standard FreeBSD tftp client and server - The Fedora Core 6 tftp client and server - Cisco router tftp client - Extreme Networks tftp client It supports the following RFCs: RFC1350 - THE TFTP PROTOCOL (REVISION 2) RFC2347 - TFTP Option Extension RFC2348 - TFTP Blocksize Option RFC2349 - TFTP Timeout Interval and Transfer Size Options RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) It supports the following unofficial TFTP Options as described at http://www.compuphase.com/tftp.htm: blksize2 - Block size restricted to powers of 2, excluding protocol headers rollover - Block counter roll-over (roll back to zero or to one) From the tftp program point of view the following things are changed: - New commands: "blocksize", "blocksize2", "rollover" and "options" - Development features: "debug" and "packetdrop" If you try this tftp/tftpd implementation, please let me know if it works (or doesn't work) and against which implementaion so I can get a list of confirmed working systems. Author: Edwin Groothuis <edwin@FreeBSD.org>
* ANSIfy, plus constify interfaces where possible.delphij2008-10-131-62/+26
|
* Use strlcpy() instead of strncpy() when we want the string to bedelphij2008-10-131-3/+2
| | | | NUL-terminated.
* Use the new name H_SETSIZE instead of the old H_EVENT to set the historystefanf2005-10-191-1/+1
| | | | | | size. PR: 86355
* Fix BSS buffer overflow in makeargv().tjr2003-10-121-2/+3
|
* tftp.1:simon2003-10-011-5/+5
| | | | | | | | | | - Add the optional port argument to SYNOPSIS. main.c: - Sync usage with the manual page. Approved by: trhodes (main.c part) Obtained from: OpenBSD (jmc) MFC after: 2 weeks
* fix reverse logic in "connect" command that cause port specifications to be ↵jon2003-03-251-2/+2
| | | | | | ignored. MFC after: 1 week
* To perform even basic error checking, one must have an exit code thatbsd2002-05-121-4/+4
| | | | | | | | indicates that not everything worked as expected. Exit non-zero if we timed out while transmitting or receiving a file or if the file did not exist, etc. MFC After: 3 days (re@ willing)
* Add some constness to make this WARNS clean again.dwmalone2002-04-131-3/+3
|
* IPv6 support for tftp/tftpd.ume2002-04-111-76/+91
| | | | | Obtained from: KAME MFC after: 2 weeks
* remove __Pimp2002-03-221-26/+26
|
* 1) Move FreeBSD ID below vendor ID and don't compile vendor ID.dwmalone2002-02-271-9/+10
| | | | | | 2) Cast some numbers we know to be positive to size_t before we MIN them with the result of a sizeof. 3) Compare result of inet_addr to INADDR_NONE, not -1.
* Argh...argv->argcguido2002-01-041-1/+1
|
* Fix the coredump that occurs when, from the tfpt prompt, a 'c' command isguido2002-01-041-1/+1
| | | | issued without an argument.
* WARNS=2 fixes. NO_WERROR set as there are some hard-to-fixmarkm2001-12-111-58/+59
| | | | signed/unsigned comparisons. Use __FBSDID().
* Fixed most style bugs in previous commit.bde2001-10-191-14/+11
|
* Add libedit support to tftp.mdodd2001-10-191-8/+44
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Rename a function name so that it doesn't conflict with a future system call.dg1998-10-301-3/+3
|
* Don't assume that hp->h_lenght == 4. Be conservative in its use.imp1998-06-091-8/+14
| | | | Submitted by: J. Assange a long time ago.
* Use err(3). 100 -> MAXHOSTNAMELEN from OpenBSD.charnier1997-08-141-21/+18
| | | | Obtained from: OpenBSD
* Don't use __dead or __pure in user code. They were obfuscationsbde1996-09-141-2/+2
| | | | | | for gcc >= 2.5 and no-ops for gcc >= 2.6. Converted to use __dead2 or __pure2 where it wasn't already done, except in math.h where use of __pure was mostly wrong.
* Kill the (hopefully) last occurance of gets(3) in the base source tree.joerg1995-12-271-6/+11
|
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+733
OpenPOWER on IntegriCloud