diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-11-19 17:35:49 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-11-19 17:35:49 +0000 |
commit | 847375f3ad4af55b9bd4d8a6daff313165de5fd8 (patch) | |
tree | 53d4acf4aaffaaaa6e7aafa52f2457fdf2758e44 /cpukit/libnetworking/kern | |
parent | Changed BOOTP -> BOOTP/DHCP. (diff) | |
download | rtems-847375f3ad4af55b9bd4d8a6daff313165de5fd8.tar.bz2 |
Patch from Eric Norum <eric@skatter.usask.ca>:
1) Socket timeout field changed from `short' to `long'. This makes longer
timeouts possible. With a 1 kHz system clock the old system allowed
timeouts only up to a little over 30 seconds! This change is a
slightly cleaned-up version of the patch proposed by Ian Lance Taylor.
2) Major changes to BOOTP/DHCP reply handling. Now supports much of
RFC2132. These changes were done at the request of, and with the
assistance of, Erik Ivanenko.
If you're making changes, you might want to change the network
supplement Essentially just do a global search and replace of BOOTP
with BOOTP/DHCP.
Diffstat (limited to 'cpukit/libnetworking/kern')
-rw-r--r-- | cpukit/libnetworking/kern/uipc_socket.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/libnetworking/kern/uipc_socket.c b/cpukit/libnetworking/kern/uipc_socket.c index 895d1c7d45..04489f4017 100644 --- a/cpukit/libnetworking/kern/uipc_socket.c +++ b/cpukit/libnetworking/kern/uipc_socket.c @@ -49,6 +49,7 @@ #include <sys/resourcevar.h> #include <sys/signalvar.h> #include <sys/sysctl.h> +#include <limits.h> static int somaxconn = SOMAXCONN; SYSCTL_INT(_kern, KERN_SOMAXCONN, somaxconn, CTLFLAG_RW, &somaxconn, 0, ""); @@ -948,14 +949,14 @@ sosetopt(so, level, optname, m0) case SO_RCVTIMEO: { struct timeval *tv; - short val; + unsigned long val; if (m == NULL || m->m_len < sizeof (*tv)) { error = EINVAL; goto bad; } tv = mtod(m, struct timeval *); - if (tv->tv_sec > SHRT_MAX / hz - hz) { + if (tv->tv_sec >= (ULONG_MAX - hz) / hz) { error = EDOM; goto bad; } @@ -1065,7 +1066,7 @@ sogetopt(so, level, optname, mp) case SO_SNDTIMEO: case SO_RCVTIMEO: { - int val = (optname == SO_SNDTIMEO ? + unsigned long val = (optname == SO_SNDTIMEO ? so->so_snd.sb_timeo : so->so_rcv.sb_timeo); m->m_len = sizeof(struct timeval); |