summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-08-23 14:58:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-08-23 14:58:16 +0000
commit48abdc31fd63fb013c131c09bed3a3ef9a230939 (patch)
treea5b61c2d087cdfa2293efbc74632aa69761f68db
parentchanged version to 19990820 (diff)
downloadrtems-48abdc31fd63fb013c131c09bed3a3ef9a230939.tar.bz2
Patch from Eric Norum <eric@cls.usask.ca> to readd the behavior where
the minor number indicated the port number to try.
-rw-r--r--c/src/exec/libnetworking/lib/tftpDriver.c36
-rw-r--r--c/src/lib/libnetworking/lib/tftpDriver.c36
-rw-r--r--c/src/libnetworking/lib/tftpDriver.c36
-rw-r--r--cpukit/libnetworking/lib/tftpDriver.c36
4 files changed, 24 insertions, 120 deletions
diff --git a/c/src/exec/libnetworking/lib/tftpDriver.c b/c/src/exec/libnetworking/lib/tftpDriver.c
index f91b89927f..8e96c8d4a9 100644
--- a/c/src/exec/libnetworking/lib/tftpDriver.c
+++ b/c/src/exec/libnetworking/lib/tftpDriver.c
@@ -519,20 +519,13 @@ int rtems_tftp_open(
int try = (now + retryCount) % 10;
tp->myAddress.sin_family = AF_INET;
- /*
- * XXX Eric .. how do we get the minor information???
- * tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- */
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try);
+ tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + s);
tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
break;
if (++retryCount == 10) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EBUSY;
}
}
@@ -554,10 +547,6 @@ int rtems_tftp_open(
* Create the request
*/
tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- /*
- * XXX Eric .. is this cast taking the const off right?
- */
-
cp1 = (char *) tp->pkbuf.tftpRWRQ.filename_mode;
cp2 = (char *) remoteFilename;
while ((*cp1++ = *cp2++) != '\0')
@@ -574,10 +563,7 @@ int rtems_tftp_open(
(struct sockaddr *)&tp->farAddress,
sizeof tp->farAddress) < 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
@@ -595,11 +581,7 @@ int rtems_tftp_open(
tp->eof = (tp->nleft < TFTP_BUFSIZE);
if (sendAck (tp) != 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
-
+ releaseStream (s);
return EIO;
}
break;
@@ -607,10 +589,7 @@ int rtems_tftp_open(
if (opcode == TFTP_OPCODE_ERROR) {
tftpSetErrno (tp);
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- * releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}
@@ -620,10 +599,7 @@ int rtems_tftp_open(
*/
if (++retryCount >= OPEN_RETRY_LIMIT) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}
diff --git a/c/src/lib/libnetworking/lib/tftpDriver.c b/c/src/lib/libnetworking/lib/tftpDriver.c
index f91b89927f..8e96c8d4a9 100644
--- a/c/src/lib/libnetworking/lib/tftpDriver.c
+++ b/c/src/lib/libnetworking/lib/tftpDriver.c
@@ -519,20 +519,13 @@ int rtems_tftp_open(
int try = (now + retryCount) % 10;
tp->myAddress.sin_family = AF_INET;
- /*
- * XXX Eric .. how do we get the minor information???
- * tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- */
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try);
+ tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + s);
tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
break;
if (++retryCount == 10) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EBUSY;
}
}
@@ -554,10 +547,6 @@ int rtems_tftp_open(
* Create the request
*/
tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- /*
- * XXX Eric .. is this cast taking the const off right?
- */
-
cp1 = (char *) tp->pkbuf.tftpRWRQ.filename_mode;
cp2 = (char *) remoteFilename;
while ((*cp1++ = *cp2++) != '\0')
@@ -574,10 +563,7 @@ int rtems_tftp_open(
(struct sockaddr *)&tp->farAddress,
sizeof tp->farAddress) < 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
@@ -595,11 +581,7 @@ int rtems_tftp_open(
tp->eof = (tp->nleft < TFTP_BUFSIZE);
if (sendAck (tp) != 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
-
+ releaseStream (s);
return EIO;
}
break;
@@ -607,10 +589,7 @@ int rtems_tftp_open(
if (opcode == TFTP_OPCODE_ERROR) {
tftpSetErrno (tp);
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- * releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}
@@ -620,10 +599,7 @@ int rtems_tftp_open(
*/
if (++retryCount >= OPEN_RETRY_LIMIT) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}
diff --git a/c/src/libnetworking/lib/tftpDriver.c b/c/src/libnetworking/lib/tftpDriver.c
index f91b89927f..8e96c8d4a9 100644
--- a/c/src/libnetworking/lib/tftpDriver.c
+++ b/c/src/libnetworking/lib/tftpDriver.c
@@ -519,20 +519,13 @@ int rtems_tftp_open(
int try = (now + retryCount) % 10;
tp->myAddress.sin_family = AF_INET;
- /*
- * XXX Eric .. how do we get the minor information???
- * tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- */
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try);
+ tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + s);
tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
break;
if (++retryCount == 10) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EBUSY;
}
}
@@ -554,10 +547,6 @@ int rtems_tftp_open(
* Create the request
*/
tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- /*
- * XXX Eric .. is this cast taking the const off right?
- */
-
cp1 = (char *) tp->pkbuf.tftpRWRQ.filename_mode;
cp2 = (char *) remoteFilename;
while ((*cp1++ = *cp2++) != '\0')
@@ -574,10 +563,7 @@ int rtems_tftp_open(
(struct sockaddr *)&tp->farAddress,
sizeof tp->farAddress) < 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
@@ -595,11 +581,7 @@ int rtems_tftp_open(
tp->eof = (tp->nleft < TFTP_BUFSIZE);
if (sendAck (tp) != 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
-
+ releaseStream (s);
return EIO;
}
break;
@@ -607,10 +589,7 @@ int rtems_tftp_open(
if (opcode == TFTP_OPCODE_ERROR) {
tftpSetErrno (tp);
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- * releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}
@@ -620,10 +599,7 @@ int rtems_tftp_open(
*/
if (++retryCount >= OPEN_RETRY_LIMIT) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}
diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c
index f91b89927f..8e96c8d4a9 100644
--- a/cpukit/libnetworking/lib/tftpDriver.c
+++ b/cpukit/libnetworking/lib/tftpDriver.c
@@ -519,20 +519,13 @@ int rtems_tftp_open(
int try = (now + retryCount) % 10;
tp->myAddress.sin_family = AF_INET;
- /*
- * XXX Eric .. how do we get the minor information???
- * tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- */
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try);
+ tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + s);
tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
break;
if (++retryCount == 10) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EBUSY;
}
}
@@ -554,10 +547,6 @@ int rtems_tftp_open(
* Create the request
*/
tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- /*
- * XXX Eric .. is this cast taking the const off right?
- */
-
cp1 = (char *) tp->pkbuf.tftpRWRQ.filename_mode;
cp2 = (char *) remoteFilename;
while ((*cp1++ = *cp2++) != '\0')
@@ -574,10 +563,7 @@ int rtems_tftp_open(
(struct sockaddr *)&tp->farAddress,
sizeof tp->farAddress) < 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
@@ -595,11 +581,7 @@ int rtems_tftp_open(
tp->eof = (tp->nleft < TFTP_BUFSIZE);
if (sendAck (tp) != 0) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
-
+ releaseStream (s);
return EIO;
}
break;
@@ -607,10 +589,7 @@ int rtems_tftp_open(
if (opcode == TFTP_OPCODE_ERROR) {
tftpSetErrno (tp);
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- * releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}
@@ -620,10 +599,7 @@ int rtems_tftp_open(
*/
if (++retryCount >= OPEN_RETRY_LIMIT) {
close (tp->socket);
- /*
- * XXX Eric .. how do we get the minor information to release this???
- releaseStream (minor);
- */
+ releaseStream (s);
return EIO;
}
}