Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: tftpd: some changes

In article <>,
Maxime Villard  <> wrote:
>here is a patch for tftpd.
>- - CVS
>The functions tsize_handler()/timeout_handler()/blk_handler() are
>given a pointer 'ec' that they are *supposed* to change when an error
>occurs. Also, they are *supposed* to return -1 to indicate that an
>error occured. But, actually, they never change 'ec' and almost
>never return -1. It means that if get_options() fails, nak() will
>send a wrong error message.
>- - PATCH
>Those three functions now return -1 when an invalid option is received,
>and they set the error code as appropriate. Since I *think* it should
>be considered as an illegal TFTP operation, I've put EBADOP. Also,
>in get_options(), I removed the variable 'ec'; it's better to pass
>directly 'ecode'. Thus, I renamed all the 'ec' to 'ecode'.
>At l.716, what's the goal of 'oack_h' ?

Remember the first 2 bytes the code skips from the buffer before it
starts putting stuff to it? This is the opcode, and it bashes it in
after thit is done. At least this is how I read it.


Looks good, I'll commit it for you.


Home | Main Index | Thread Index | Old Index