Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115415946
D33406.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33406.diff
View Options
diff --git a/stand/libsa/tftp.c b/stand/libsa/tftp.c
--- a/stand/libsa/tftp.c
+++ b/stand/libsa/tftp.c
@@ -122,7 +122,7 @@
#define TFTP_MAX_ERRCODE EOPTNEG
static const int tftperrors[TFTP_MAX_ERRCODE + 1] = {
- 0, /* ??? */
+ 0, /* NAK */
ENOENT,
EPERM,
ENOSPC,
@@ -188,6 +188,7 @@
struct tftphdr *t;
void *ptr = NULL;
ssize_t len;
+ int tftp_error;
errno = 0;
extra = recv_extra;
@@ -234,16 +235,20 @@
return (got);
}
case ERROR:
- if ((unsigned)ntohs(t->th_code) > TFTP_MAX_ERRCODE) {
- printf("illegal tftp error %d\n", ntohs(t->th_code));
+ tftp_error = ntohs(t->th_code);
+ if ((unsigned)tftp_error > TFTP_MAX_ERRCODE) {
+ printf("illegal tftp error %d\n", tftp_error);
errno = EIO;
} else {
#ifdef TFTP_DEBUG
- printf("tftp-error %d\n", ntohs(t->th_code));
+ printf("tftp-error %d\n", tftp_error);
#endif
- errno = tftperrors[ntohs(t->th_code)];
+ errno = tftperrors[tftp_error];
}
free(ptr);
+ /* If we got a NAK return 0, it's usually a directory */
+ if (tftp_error == 0)
+ return (0);
return (-1);
case OACK: {
struct udphdr *uh;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 24, 2:10 PM (16 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17760312
Default Alt Text
D33406.diff (1 KB)
Attached To
Mode
D33406: loader: tftp: Don't error on tftp error 0
Attached
Detach File
Event Timeline
Log In to Comment