|
|
| version 1.2, 2014/02/17 14:28:29 | version 1.3, 2014/02/18 12:46:39 |
|---|---|
| Line 116 txAck(sched_task_t *task) | Line 116 txAck(sched_task_t *task) |
| taskExit(task, NULL); | taskExit(task, NULL); |
| } | } |
| static int | |
| getOpts(const char *opts, int rlen) | |
| { | |
| if (!opts) | |
| return -1; | |
| return 0; | |
| } | |
| static void * | static void * |
| RQ(sched_task_t *task) | RQ(sched_task_t *task) |
| { | { |
| rpack_t *pkt = TASK_DATA(task); | rpack_t *pkt = TASK_DATA(task); |
| struct tftp_hdr *tftp = (struct tftp_hdr*) RPACK_BUF(pkt); | struct tftp_hdr *tftp = (struct tftp_hdr*) RPACK_BUF(pkt); |
| int len, rlen = TASK_DATLEN(task) - 2; | int len, rlen = TASK_DATLEN(task) - 2; |
| char *str; | char *str, *opts; |
| u_short code = 0; | u_short code = 0; |
| ETRACE(); | ETRACE(); |
| Line 135 RQ(sched_task_t *task) | Line 144 RQ(sched_task_t *task) |
| rlen -= len; | rlen -= len; |
| strlcpy(cli.file, (char*) tftp->tftp_data, sizeof cli.file); | strlcpy(cli.file, (char*) tftp->tftp_data, sizeof cli.file); |
| } | } |
| len = str_getString((const u_char*) str, rlen, NULL); | len = str_getString((const u_char*) str, rlen, &opts); |
| if (len == -1) | if (len == -1) |
| goto end; | goto end; |
| else { | else { |
| Line 153 RQ(sched_task_t *task) | Line 162 RQ(sched_task_t *task) |
| goto end; | goto end; |
| } | } |
| } | } |
| /* tftp extended options */ | |
| if (!RPACK_ISEND(pkt) && !getOpts(opts, rlen)) | |
| cli.opts = 42; /* we have options */ | |
| cli.opc = ntohs(tftp->tftp_opc); | cli.opc = ntohs(tftp->tftp_opc); |
| switch (cli.opc) { | switch (cli.opc) { |