summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/nfs
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2009-04-28 11:12:03 +0000
committerChris Johns <chrisj@rtems.org>2009-04-28 11:12:03 +0000
commit046fe12b336f2dd06bfec543c3f67db1b5554774 (patch)
tree9eb36059bf4a950d802fddbb6feb7b7e0550affa /cpukit/libnetworking/nfs
parent2009-04-28 Chris Johns <chrisj@rtems.org> (diff)
downloadrtems-046fe12b336f2dd06bfec543c3f67db1b5554774.tar.bz2
2009-04-28 Chris Johns <chrisj@rtems.org>
* libnetworking/nfs/bootp_subr.c: Fixed PR1384. The route set in the initialise pass is not deleted so an exists error is returned. Ignore the error. Print the server address as an IP address not hex digits. * libnetworking/rtems/rtems_dhcp.c: Fixed PR1338. Close the socket, handle the returned event flags.
Diffstat (limited to 'cpukit/libnetworking/nfs')
-rw-r--r--cpukit/libnetworking/nfs/bootp_subr.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
index 4e8fc94d76..7a0e8901f6 100644
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ b/cpukit/libnetworking/nfs/bootp_subr.c
@@ -464,10 +464,12 @@ bootpc_call(
} /* while secs */
} /* forever send/receive */
-
- printf("BOOTP timeout for server 0x%x\n",
- (int)ntohl(sin->sin_addr.s_addr));
-
+ {
+ uint32_t addr = ntohl(sin->sin_addr.s_addr);
+ printf("BOOTP timeout for server %lu.%lu.%lu.%lu\n",
+ (addr >> 24) & 0xff, (addr >> 16) & 0xff,
+ (addr >> 8) & 0xff, addr & 0xff);
+ }
error = ETIMEDOUT;
goto out;
@@ -518,7 +520,12 @@ bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = INADDR_ANY;
error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error) {
+ /*
+ * Ignore a File already exists (EEXIST) error code. This means a
+ * route for the address is already present and is returned on
+ * a second pass to here.
+ */
+ if (error && (error != EEXIST)) {
printf("bootpc_fakeup_interface: set if addr, error=%s\n", strerror(error));
return error;
}
@@ -549,7 +556,6 @@ bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
return error;
}
-
/* Add default route to 0.0.0.0 so we can send data */
bzero((caddr_t) &dst, sizeof(dst));
@@ -573,8 +579,10 @@ bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
(struct sockaddr *) &mask,
RTF_UP | RTF_STATIC
, NULL);
- if (error)
- printf("bootpc_fakeup_interface: add default route, error=%d\n", error);
+ if (error && error != EEXIST)
+ printf("bootpc_fakeup_interface: add default route, error=%s\n",
+ strerror(error));
+
return error;
}