[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: tftpd: some changes
Le 04/07/2013 04:54, Christos Zoulas a écrit :
> In article <51D46245.5090204%M00nBSD.net@localhost>,
> Maxime Villard <max%M00nBSD.net@localhost> 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'.
>> - - REMARK
>> At l.716, what's the goal of 'oack_h' ?
Ah ! I misread the code.
> 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.
Main Index |
Thread Index |