123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- #include "libbb.h"
- #include "common_bufsiz.h"
- #include <syslog.h>
- #if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT
- #define TFTP_BLKSIZE_DEFAULT 512
- #define TFTP_BLKSIZE_DEFAULT_STR "512"
- #define TFTP_TIMEOUT_MS 100
- #define TFTP_MAXTIMEOUT_MS 2000
- #define TFTP_NUM_RETRIES 12
- #define TFTP_RRQ 1
- #define TFTP_WRQ 2
- #define TFTP_DATA 3
- #define TFTP_ACK 4
- #define TFTP_ERROR 5
- #define TFTP_OACK 6
- #define ERR_UNSPEC 0
- #define ERR_NOFILE 1
- #define ERR_ACCESS 2
- #define ERR_WRITE 3
- #define ERR_OP 4
- #define ERR_BAD_ID 5
- #define ERR_EXIST 6
- #define ERR_BAD_USER 7
- #define ERR_BAD_OPT 8
- enum {
- TFTP_OPT_GET = (1 << 0),
- TFTP_OPT_PUT = (1 << 1),
-
- TFTPD_OPT = (1 << 7) * ENABLE_TFTPD,
- TFTPD_OPT_r = (1 << 8) * ENABLE_TFTPD,
- TFTPD_OPT_c = (1 << 9) * ENABLE_TFTPD,
- TFTPD_OPT_u = (1 << 10) * ENABLE_TFTPD,
- TFTPD_OPT_l = (1 << 11) * ENABLE_TFTPD,
- };
- #if ENABLE_FEATURE_TFTP_GET && !ENABLE_FEATURE_TFTP_PUT
- #define IF_GETPUT(...)
- #define CMD_GET(cmd) 1
- #define CMD_PUT(cmd) 0
- #elif !ENABLE_FEATURE_TFTP_GET && ENABLE_FEATURE_TFTP_PUT
- #define IF_GETPUT(...)
- #define CMD_GET(cmd) 0
- #define CMD_PUT(cmd) 1
- #else
- #define IF_GETPUT(...) __VA_ARGS__
- #define CMD_GET(cmd) ((cmd) & TFTP_OPT_GET)
- #define CMD_PUT(cmd) ((cmd) & TFTP_OPT_PUT)
- #endif
- struct globals {
-
- uint8_t error_pkt[4 + 32];
- struct passwd *pw;
-
-
- char block_buf[516];
- char block_buf_tail[1];
- #if ENABLE_FEATURE_TFTP_PROGRESS_BAR
- off_t pos;
- off_t size;
- const char *file;
- bb_progress_t pmt;
- #endif
- } FIX_ALIASING;
- #define G (*(struct globals*)bb_common_bufsiz1)
- #define INIT_G() do { \
- setup_common_bufsiz(); \
- BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
- } while (0)
- #define G_error_pkt_reason (G.error_pkt[3])
- #define G_error_pkt_str ((char*)(G.error_pkt + 4))
- #if ENABLE_FEATURE_TFTP_PROGRESS_BAR && ENABLE_FEATURE_TFTP_BLOCKSIZE
- static void tftp_progress_update(void)
- {
- bb_progress_update(&G.pmt, 0, G.pos, G.size);
- }
- static void tftp_progress_init(void)
- {
- bb_progress_init(&G.pmt, G.file);
- tftp_progress_update();
- }
- static void tftp_progress_done(void)
- {
- if (is_bb_progress_inited(&G.pmt)) {
- tftp_progress_update();
- bb_putchar_stderr('\n');
- bb_progress_free(&G.pmt);
- }
- }
- #else
- # define tftp_progress_update() ((void)0)
- # define tftp_progress_init() ((void)0)
- # define tftp_progress_done() ((void)0)
- #endif
- #if ENABLE_FEATURE_TFTP_BLOCKSIZE
- static int tftp_blksize_check(const char *blksize_str, int maxsize)
- {
-
- unsigned blksize = bb_strtou(blksize_str, NULL, 10);
- if (errno
- || (blksize < 24) || (blksize > maxsize)
- ) {
- bb_error_msg("bad blocksize '%s'", blksize_str);
- return -1;
- }
- # if ENABLE_TFTP_DEBUG
- bb_error_msg("using blksize %u", blksize);
- # endif
- return blksize;
- }
- static char *tftp_get_option(const char *option, char *buf, int len)
- {
- int opt_val = 0;
- int opt_found = 0;
- int k;
-
- while (len > 0) {
-
- for (k = 0; k < len; k++) {
- if (buf[k] == '\0') {
- goto nul_found;
- }
- }
- return NULL;
- nul_found:
- if (opt_val == 0) {
- if (strcasecmp(buf, option) == 0) {
- opt_found = 1;
- }
- } else if (opt_found) {
- return buf;
- }
- k++;
- buf += k;
- len -= k;
- opt_val ^= 1;
- }
- return NULL;
- }
- #endif
- static int tftp_protocol(
-
- len_and_sockaddr *our_lsa,
- len_and_sockaddr *peer_lsa,
- const char *local_file
- IF_TFTP(, const char *remote_file)
- #if !ENABLE_TFTP
- # define remote_file NULL
- #endif
-
- IF_FEATURE_TFTP_BLOCKSIZE(, int want_transfer_size)
- IF_FEATURE_TFTP_BLOCKSIZE(, int blksize))
- {
- #if !ENABLE_FEATURE_TFTP_BLOCKSIZE
- enum { blksize = TFTP_BLKSIZE_DEFAULT };
- #endif
- struct pollfd pfd[1];
- #define socket_fd (pfd[0].fd)
- int len;
- int send_len;
- IF_FEATURE_TFTP_BLOCKSIZE(smallint expect_OACK = 0;)
- smallint finished = 0;
- uint16_t opcode;
- uint16_t block_nr;
- uint16_t recv_blk;
- int open_mode, local_fd;
- int retries, waittime_ms;
- int io_bufsize = blksize + 4;
- char *cp;
-
- char *xbuf = xmalloc(io_bufsize);
- char *rbuf = xmalloc(io_bufsize);
- socket_fd = xsocket(peer_lsa->u.sa.sa_family, SOCK_DGRAM, 0);
- setsockopt_reuseaddr(socket_fd);
- if (!ENABLE_TFTP || our_lsa) {
-
- xbind(socket_fd, &our_lsa->u.sa, our_lsa->len);
- xconnect(socket_fd, &peer_lsa->u.sa, peer_lsa->len);
-
- if (G_error_pkt_reason || G_error_pkt_str[0])
- goto send_err_pkt;
- if (G.pw) {
- change_identity(G.pw);
- }
- }
-
- if (CMD_PUT(option_mask32)) {
- open_mode = O_RDONLY;
- } else {
- open_mode = O_WRONLY | O_TRUNC | O_CREAT;
- #if ENABLE_TFTPD
- if ((option_mask32 & (TFTPD_OPT+TFTPD_OPT_c)) == TFTPD_OPT) {
-
- open_mode = O_WRONLY | O_TRUNC;
- }
- #endif
- }
-
- block_nr = 1;
- cp = xbuf + 2;
- if (!ENABLE_TFTP || our_lsa) {
-
- local_fd = open(local_file, open_mode, 0666);
- if (local_fd < 0) {
- G_error_pkt_reason = ERR_NOFILE;
- strcpy(G_error_pkt_str, "can't open file");
- goto send_err_pkt;
- }
- #if ENABLE_FEATURE_TFTP_BLOCKSIZE
- if (blksize != TFTP_BLKSIZE_DEFAULT || want_transfer_size) {
-
-
- opcode = TFTP_OACK;
- goto add_blksize_opt;
- }
- #endif
- if (CMD_GET(option_mask32)) {
-
- block_nr = 0;
- }
- } else {
-
- local_fd = CMD_GET(option_mask32) ? STDOUT_FILENO : STDIN_FILENO;
- if (NOT_LONE_DASH(local_file))
- local_fd = xopen(local_file, open_mode);
- #if ENABLE_TFTP
-
-
-
- opcode = TFTP_WRQ;
- if (CMD_GET(option_mask32)) {
- opcode = TFTP_RRQ;
- }
-
-
- len = strlen(remote_file) + 1;
- if (2 + len + sizeof("octet") >= io_bufsize) {
- bb_error_msg("remote filename is too long");
- goto ret;
- }
- strcpy(cp, remote_file);
- cp += len;
-
- strcpy(cp, "octet");
- cp += sizeof("octet");
- # if ENABLE_FEATURE_TFTP_BLOCKSIZE
- if (blksize == TFTP_BLKSIZE_DEFAULT && !want_transfer_size)
- goto send_pkt;
-
- if ((&xbuf[io_bufsize - 1] - cp) < sizeof("blksize NNNNN tsize ") + sizeof(off_t)*3) {
- bb_error_msg("remote filename is too long");
- goto ret;
- }
- expect_OACK = 1;
- # endif
- #endif
- #if ENABLE_FEATURE_TFTP_BLOCKSIZE
- add_blksize_opt:
- if (blksize != TFTP_BLKSIZE_DEFAULT) {
-
- strcpy(cp, "blksize");
- cp += sizeof("blksize");
- cp += snprintf(cp, 6, "%d", blksize) + 1;
- }
- if (want_transfer_size) {
-
-
-
-
-
- struct stat st;
- strcpy(cp, "tsize");
- cp += sizeof("tsize");
- st.st_size = 0;
- fstat(local_fd, &st);
- cp += sprintf(cp, "%"OFF_FMT"u", (off_t)st.st_size) + 1;
- # if ENABLE_FEATURE_TFTP_PROGRESS_BAR
-
- G.size = st.st_size;
- if (remote_file && st.st_size)
- tftp_progress_init();
- # endif
- }
- #endif
-
- goto send_pkt;
- }
-
- while (1) {
-
- cp = xbuf + 2;
- *((uint16_t*)cp) = htons(block_nr);
- cp += 2;
- block_nr++;
- opcode = TFTP_ACK;
- if (CMD_PUT(option_mask32)) {
- opcode = TFTP_DATA;
- len = full_read(local_fd, cp, blksize);
- if (len < 0) {
- goto send_read_err_pkt;
- }
- if (len != blksize) {
- finished = 1;
- }
- cp += len;
- IF_FEATURE_TFTP_PROGRESS_BAR(G.pos += len;)
- }
- send_pkt:
-
- *((uint16_t*)xbuf) = htons(opcode);
- send_len = cp - xbuf;
-
- retries = TFTP_NUM_RETRIES;
- waittime_ms = TFTP_TIMEOUT_MS;
- send_again:
- #if ENABLE_TFTP_DEBUG
- fprintf(stderr, "sending %u bytes\n", send_len);
- for (cp = xbuf; cp < &xbuf[send_len]; cp++)
- fprintf(stderr, "%02x ", (unsigned char) *cp);
- fprintf(stderr, "\n");
- #endif
- xsendto(socket_fd, xbuf, send_len, &peer_lsa->u.sa, peer_lsa->len);
- #if ENABLE_FEATURE_TFTP_PROGRESS_BAR
- if (is_bb_progress_inited(&G.pmt))
- tftp_progress_update();
- #endif
-
- if (finished && (opcode == TFTP_ACK))
- goto ret;
- recv_again:
-
-
- pfd[0].events = POLLIN;
- switch (safe_poll(pfd, 1, waittime_ms)) {
- default:
-
- goto ret;
- case 0:
- retries--;
- if (retries == 0) {
- tftp_progress_done();
- bb_error_msg("timeout");
- goto ret;
- }
-
- waittime_ms += waittime_ms/2;
- if (waittime_ms > TFTP_MAXTIMEOUT_MS) {
- waittime_ms = TFTP_MAXTIMEOUT_MS;
- }
- goto send_again;
- case 1:
- if (!our_lsa) {
-
- our_lsa = ((void*)(ptrdiff_t)-1);
- len = recvfrom(socket_fd, rbuf, io_bufsize, 0,
- &peer_lsa->u.sa, &peer_lsa->len);
-
- if (len >= 0)
- xconnect(socket_fd, &peer_lsa->u.sa, peer_lsa->len);
- } else {
-
-
- len = safe_read(socket_fd, rbuf, io_bufsize);
- }
- if (len < 0) {
- goto send_read_err_pkt;
- }
- if (len < 4) {
- goto recv_again;
- }
- }
-
- opcode = ntohs( ((uint16_t*)rbuf)[0] );
- recv_blk = ntohs( ((uint16_t*)rbuf)[1] );
- #if ENABLE_TFTP_DEBUG
- fprintf(stderr, "received %d bytes: %04x %04x\n", len, opcode, recv_blk);
- #endif
- if (opcode == TFTP_ERROR) {
- static const char errcode_str[] ALIGN1 =
- "\0"
- "file not found\0"
- "access violation\0"
- "disk full\0"
- "bad operation\0"
- "unknown transfer id\0"
- "file already exists\0"
- "no such user\0"
- "bad option";
- const char *msg = "";
- if (len > 4 && rbuf[4] != '\0') {
- msg = &rbuf[4];
- rbuf[io_bufsize - 1] = '\0';
- } else if (recv_blk <= 8) {
- msg = nth_string(errcode_str, recv_blk);
- }
- bb_error_msg("server error: (%u) %s", recv_blk, msg);
- goto ret;
- }
- #if ENABLE_FEATURE_TFTP_BLOCKSIZE
- if (expect_OACK) {
- expect_OACK = 0;
- if (opcode == TFTP_OACK) {
-
- char *res;
- res = tftp_get_option("blksize", &rbuf[2], len - 2);
- if (res) {
- blksize = tftp_blksize_check(res, blksize);
- if (blksize < 0) {
- G_error_pkt_reason = ERR_BAD_OPT;
- goto send_err_pkt;
- }
- io_bufsize = blksize + 4;
- }
- # if ENABLE_FEATURE_TFTP_PROGRESS_BAR
- if (remote_file && G.size == 0) {
- res = tftp_get_option("tsize", &rbuf[2], len - 2);
- if (res) {
- G.size = bb_strtoull(res, NULL, 10);
- if (G.size)
- tftp_progress_init();
- }
- }
- # endif
- if (CMD_GET(option_mask32)) {
-
- block_nr = 0;
- }
- continue;
- }
-
- if (blksize != TFTP_BLKSIZE_DEFAULT)
- bb_error_msg("falling back to blocksize "TFTP_BLKSIZE_DEFAULT_STR);
- blksize = TFTP_BLKSIZE_DEFAULT;
- io_bufsize = TFTP_BLKSIZE_DEFAULT + 4;
- }
- #endif
-
- if (CMD_GET(option_mask32) && (opcode == TFTP_DATA)) {
- if (recv_blk == block_nr) {
- int sz = full_write(local_fd, &rbuf[4], len - 4);
- if (sz != len - 4) {
- strcpy(G_error_pkt_str, bb_msg_write_error);
- G_error_pkt_reason = ERR_WRITE;
- goto send_err_pkt;
- }
- if (sz != blksize) {
- finished = 1;
- }
- IF_FEATURE_TFTP_PROGRESS_BAR(G.pos += sz;)
- continue;
- }
- #if 0
- if (recv_blk == (block_nr - 1)) {
-
- block_nr = recv_blk;
- continue;
- }
- #endif
- }
- if (CMD_PUT(option_mask32) && (opcode == TFTP_ACK)) {
-
- if (recv_blk == (uint16_t) (block_nr - 1)) {
- if (finished)
- goto ret;
- continue;
- }
- }
-
- goto recv_again;
-
- }
- ret:
- if (ENABLE_FEATURE_CLEAN_UP) {
- close(local_fd);
- close(socket_fd);
- free(xbuf);
- free(rbuf);
- }
- return finished == 0;
- send_read_err_pkt:
- strcpy(G_error_pkt_str, bb_msg_read_error);
- send_err_pkt:
- if (G_error_pkt_str[0])
- bb_error_msg("%s", G_error_pkt_str);
- G.error_pkt[1] = TFTP_ERROR;
- xsendto(socket_fd, G.error_pkt, 4 + 1 + strlen(G_error_pkt_str),
- &peer_lsa->u.sa, peer_lsa->len);
- return EXIT_FAILURE;
- #undef remote_file
- }
- #if ENABLE_TFTP
- int tftp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- int tftp_main(int argc UNUSED_PARAM, char **argv)
- {
- len_and_sockaddr *peer_lsa;
- const char *local_file = NULL;
- const char *remote_file = NULL;
- # if ENABLE_FEATURE_TFTP_BLOCKSIZE
- const char *blksize_str = TFTP_BLKSIZE_DEFAULT_STR;
- int blksize;
- # endif
- int result;
- int port;
- IF_GETPUT(int opt;)
- INIT_G();
- IF_GETPUT(opt =) getopt32(argv, "^"
- IF_FEATURE_TFTP_GET("g") IF_FEATURE_TFTP_PUT("p")
- "l:r:" IF_FEATURE_TFTP_BLOCKSIZE("b:")
- "\0"
-
- IF_FEATURE_TFTP_GET("g:") IF_FEATURE_TFTP_PUT("p:")
- IF_GETPUT("g--p:p--g:"),
- &local_file, &remote_file
- IF_FEATURE_TFTP_BLOCKSIZE(, &blksize_str)
- );
- argv += optind;
- # if ENABLE_FEATURE_TFTP_BLOCKSIZE
-
- blksize = tftp_blksize_check(blksize_str, 65564);
- if (blksize < 0) {
-
- return EXIT_FAILURE;
- }
- # endif
- if (remote_file) {
- if (!local_file) {
- const char *slash = strrchr(remote_file, '/');
- local_file = slash ? slash + 1 : remote_file;
- }
- } else {
- remote_file = local_file;
- }
-
- if (!remote_file || !argv[0])
- bb_show_usage();
- port = bb_lookup_port(argv[1], "udp", 69);
- peer_lsa = xhost2sockaddr(argv[0], port);
- # if ENABLE_TFTP_DEBUG
- fprintf(stderr, "using server '%s', remote_file '%s', local_file '%s'\n",
- xmalloc_sockaddr2dotted(&peer_lsa->u.sa),
- remote_file, local_file);
- # endif
- # if ENABLE_FEATURE_TFTP_PROGRESS_BAR
- G.file = remote_file;
- # endif
- result = tftp_protocol(
- NULL , peer_lsa,
- local_file, remote_file
- IF_FEATURE_TFTP_BLOCKSIZE(, 1 )
- IF_FEATURE_TFTP_BLOCKSIZE(, blksize)
- );
- tftp_progress_done();
- if (result != EXIT_SUCCESS && NOT_LONE_DASH(local_file) && CMD_GET(opt)) {
- unlink(local_file);
- }
- return result;
- }
- #endif
- #if ENABLE_TFTPD
- int tftpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- int tftpd_main(int argc UNUSED_PARAM, char **argv)
- {
- len_and_sockaddr *our_lsa;
- len_and_sockaddr *peer_lsa;
- char *mode, *user_opt;
- char *local_file = local_file;
- const char *error_msg;
- int opt, result, opcode;
- IF_FEATURE_TFTP_BLOCKSIZE(int blksize = TFTP_BLKSIZE_DEFAULT;)
- IF_FEATURE_TFTP_BLOCKSIZE(int want_transfer_size = 0;)
- INIT_G();
- our_lsa = get_sock_lsa(STDIN_FILENO);
- if (!our_lsa) {
-
- bb_show_usage();
-
- }
- peer_lsa = xzalloc(LSA_LEN_SIZE + our_lsa->len);
- peer_lsa->len = our_lsa->len;
-
- opt = option_mask32 = TFTPD_OPT | (getopt32(argv, "rcu:l", &user_opt) << 8);
- argv += optind;
- if (opt & TFTPD_OPT_l) {
- openlog(applet_name, LOG_PID, LOG_DAEMON);
- logmode = LOGMODE_SYSLOG;
- }
- if (opt & TFTPD_OPT_u) {
-
- G.pw = xgetpwnam(user_opt);
- }
- if (argv[0]) {
- xchroot(argv[0]);
- }
- result = recv_from_to(STDIN_FILENO,
- G.block_buf, sizeof(G.block_buf) + 1,
-
- 0 ,
- &peer_lsa->u.sa, &our_lsa->u.sa, our_lsa->len);
- error_msg = "malformed packet";
- opcode = ntohs(*(uint16_t*)G.block_buf);
- if (result < 4 || result > sizeof(G.block_buf)
-
- || (IF_FEATURE_TFTP_PUT(opcode != TFTP_RRQ)
- IF_GETPUT(&&)
- IF_FEATURE_TFTP_GET(opcode != TFTP_WRQ)
- )
- ) {
- goto err;
- }
-
- G.block_buf_tail[0] = '\0';
- local_file = G.block_buf + 2;
- if (local_file[0] == '.' || strstr(local_file, "/.")) {
- error_msg = "dot in file name";
- goto err;
- }
- mode = local_file + strlen(local_file) + 1;
-
- if (mode >= G.block_buf + result || strcasecmp(mode, "octet") != 0) {
- goto err;
- }
- # if ENABLE_FEATURE_TFTP_BLOCKSIZE
- {
- char *res;
- char *opt_str = mode + sizeof("octet");
- int opt_len = G.block_buf + result - opt_str;
- if (opt_len > 0) {
- res = tftp_get_option("blksize", opt_str, opt_len);
- if (res) {
- blksize = tftp_blksize_check(res, 65564);
- if (blksize < 0) {
- G_error_pkt_reason = ERR_BAD_OPT;
-
- goto do_proto;
- }
- }
- if (opcode != TFTP_WRQ
-
- && tftp_get_option("tsize", opt_str, opt_len)
- ) {
- want_transfer_size = 1;
- }
- }
- }
- # endif
- if (!ENABLE_FEATURE_TFTP_PUT || opcode == TFTP_WRQ) {
- if (opt & TFTPD_OPT_r) {
-
-
- error_msg = bb_msg_write_error;
- goto err;
- }
- IF_GETPUT(option_mask32 |= TFTP_OPT_GET;)
- } else {
- IF_GETPUT(option_mask32 |= TFTP_OPT_PUT;)
- }
-
- do_proto:
- close(STDIN_FILENO);
-
- result = tftp_protocol(
- our_lsa, peer_lsa,
- local_file IF_TFTP(, NULL )
- IF_FEATURE_TFTP_BLOCKSIZE(, want_transfer_size)
- IF_FEATURE_TFTP_BLOCKSIZE(, blksize)
- );
- return result;
- err:
- strcpy(G_error_pkt_str, error_msg);
- goto do_proto;
- }
- #endif
- #endif
|