This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: tftp fix for eCos applications
> I don't have any hardware to test with at the moment. If Gary does not
> beat me too it, i will test this tonight and commit it tomorrow.
It took me a little longer, but its committed now.
Andrew
Index: current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/ChangeLog,v
retrieving revision 1.24
diff -u -r1.24 ChangeLog
--- current/ChangeLog 17 Mar 2003 18:39:00 -0000 1.24
+++ current/ChangeLog 18 Mar 2003 11:47:07 -0000
@@ -1,3 +1,8 @@
+2003-03-18 Barton Meeks <bartonm2002 at yahoo dot com>
+
+ * src/tftp_client.c: Reduce size of initial request packet
+ for compatibility with some tftp servers.
+
2003-03-14 Nick Garnett <nickg at balti dot calivar dot com>
* cdl/net.cdl: Added CYGDBG_NET_SHOW_MBUFS option to turn on
Index: current/src/tftp_client.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/src/tftp_client.c,v
retrieving revision 1.3
diff -u -r1.3 tftp_client.c
--- current/src/tftp_client.c 12 Jan 2003 04:53:28 -0000 1.3
+++ current/src/tftp_client.c 18 Mar 2003 11:47:08 -0000
@@ -137,7 +137,7 @@
}
// Send request
- if (sendto(s, data, sizeof(data), 0,
+ if (sendto(s, data, (int)(cp - data), 0,
(struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
// Problem sending request
*err = TFTP_NETERR;
@@ -306,7 +306,7 @@
while (*fp) *cp++ = *fp++;
*cp++ = '\0';
// Send request
- if (sendto(s, data, sizeof(data), 0,
+ if (sendto(s, data, (int)(cp-data), 0,
(struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
// Problem sending request
*err = TFTP_NETERR;