1
1

Initial dump from Zyxel

This commit is contained in:
2026-04-17 17:00:52 +02:00
commit 81fec250f4
23116 changed files with 5231237 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
diff --git a/tftpd.h b/tftpd.h
index 945065e..4c2f214 100644
--- a/tftpd.h
+++ b/tftpd.h
@@ -46,7 +46,7 @@ struct thread_data {
char *mc_addr; /* multicast address */
struct sockaddr_storage sa_mcast;
union ip_mreq_storage mcastaddr;
- u_char mcast_ttl;
+ unsigned char mcast_ttl;
/*
* Self can read/write until client_ready is set. Then only allowed to read.
@@ -0,0 +1,13 @@
diff --git a/tftp_io.c b/tftp_io.c
index 605a9c2..6cce1f4 100644
--- a/tftp_io.c
+++ b/tftp_io.c
@@ -64,7 +64,7 @@ int tftp_send_request(int socket, struct sockaddr_storage *sa, short type,
buf_index += strlen(mode);
buf_index++;
- for (i = 2; ; i++)
+ for (i = 2; i < OPT_NUMBER; i++)
{
if (strlen(tftp_options[i].option) == 0)
break;
@@ -0,0 +1,55 @@
diff --git a/tftp_def.c b/tftp_def.c
index 96abdc5..16240f7 100644
--- a/tftp_def.c
+++ b/tftp_def.c
@@ -141,7 +141,7 @@ int print_eng(double value, char *string, int size, char *format)
/*
* This is a strncpy function that take care of string NULL termination
*/
-inline char *Strncpy(char *to, const char *from, size_t size)
+char *Strncpy(char *to, const char *from, size_t size)
{
strncpy(to, from, size);
if (size>0)
diff --git a/tftp_def.h b/tftp_def.h
index e4b338d..4418ee7 100644
--- a/tftp_def.h
+++ b/tftp_def.h
@@ -50,7 +50,7 @@ extern char *tftp_errmsg[9];
int timeval_diff(struct timeval *res, struct timeval *t1, struct timeval *t0);
int print_eng(double value, char *string, int size, char *format);
-inline char *Strncpy(char *to, const char *from, size_t size);
+char *Strncpy(char *to, const char *from, size_t size);
int Gethostbyname(char *addr, struct hostent *host);
char *sockaddr_print_addr(const struct sockaddr_storage *, char *, size_t);
diff --git a/tftpd.h b/tftpd.h
index 945065e..4bd3f17 100644
--- a/tftpd.h
+++ b/tftpd.h
@@ -93,7 +93,7 @@ int tftpd_list_find_multicast_server_and_add(struct thread_data **thread,
/*
* Defined in tftpd_list.c, operation on client structure list.
*/
-inline void tftpd_clientlist_ready(struct thread_data *thread);
+void tftpd_clientlist_ready(struct thread_data *thread);
void tftpd_clientlist_remove(struct thread_data *thread,
struct client_info *client);
void tftpd_clientlist_free(struct thread_data *thread);
diff --git a/tftpd_list.c b/tftpd_list.c
index f376159..159ffca 100644
--- a/tftpd_list.c
+++ b/tftpd_list.c
@@ -201,7 +201,7 @@ int tftpd_list_find_multicast_server_and_add(struct thread_data **thread,
return 0;
}
-inline void tftpd_clientlist_ready(struct thread_data *thread)
+void tftpd_clientlist_ready(struct thread_data *thread)
{
pthread_mutex_lock(&thread->client_mutex);
thread->client_ready = 1;
--
2.1.4
@@ -0,0 +1,13 @@
Index: atftp-0.7.1/tftp.c
===================================================================
--- atftp-0.7.1.orig/tftp.c 2012-07-30 14:22:41.000000000 +0800
+++ atftp-0.7.1/tftp.c 2018-05-17 15:34:01.021829398 +0800
@@ -592,7 +592,7 @@
if (opt_get_options(data.tftp_options, argv[1], value) == ERR)
fprintf(stderr, "Option %s disabled\n", argv[1]);
else
- fprintf(stderr, "Option %s = %s\n", argv[1], value);
+ //fprintf(stderr, "Option %s = %s\n", argv[1], value);
return OK;
}
@@ -0,0 +1,22 @@
Index: atftp-0.7.1/tftp_file.c
===================================================================
--- atftp-0.7.1.orig/tftp_file.c 2012-07-31 14:17:34.000000000 +0800
+++ atftp-0.7.1/tftp_file.c 2018-06-07 16:24:14.037611233 +0800
@@ -594,9 +594,17 @@
close(mcast_sockfd);
/* return proper error code */
if (state == S_END)
+ {
+ fprintf(stderr, "tftp: download file successfully\n");
return OK;
+ }
else
+ {
fprintf(stderr, "tftp: aborting\n");
+ fprintf(stderr, "tftp: download file fail\n");
+ remove(data->local_file);
+ }
+ // passthru
default:
return ERR;
}
@@ -0,0 +1,13 @@
Index: atftp-0.7.1/argz.h
===================================================================
--- atftp-0.7.1.orig/argz.h 2011-03-11 14:51:24.000000000 +0800
+++ atftp-0.7.1/argz.h 2018-11-01 13:51:25.178883244 +0800
@@ -177,7 +177,7 @@
extern char *argz_next (__const char *__restrict __argz, size_t __argz_len,
__const char *__restrict __entry) __THROW;
-#ifdef __USE_EXTERN_INLINES
+#if 0
extern inline char *
__argz_next (__const char *__argz, size_t __argz_len,
__const char *__entry)