diff options
author | jdp <jdp@FreeBSD.org> | 2002-07-24 03:02:43 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 2002-07-24 03:02:43 +0000 |
commit | 86b3836232069126cbad3fccd52778f5adc4a676 (patch) | |
tree | 23efb20689613024e75cb76a8367533e47d49173 /sys | |
parent | ccc9f3815e7af0c92ecbd5c93328262a5a5f246e (diff) | |
download | FreeBSD-src-86b3836232069126cbad3fccd52778f5adc4a676.zip FreeBSD-src-86b3836232069126cbad3fccd52778f5adc4a676.tar.gz |
Widen struct sockbuf's sb_timeo member to int from short. With
non-default but reasonable values of hz this member overflowed,
breaking NFS over UDP.
Also, as long as I'm plowing up struct sockbuf ... Change certain
members from u_long/long to u_int/int in order to reduce wasted
space on 64-bit machines. This change was requested by Andrew
Gallatin.
Netstat and systat need to be rebuilt. I am incrementing
__FreeBSD_version in case any ports need to change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_resource.c | 4 | ||||
-rw-r--r-- | sys/sys/param.h | 2 | ||||
-rw-r--r-- | sys/sys/resourcevar.h | 2 | ||||
-rw-r--r-- | sys/sys/socketvar.h | 26 |
4 files changed, 17 insertions, 17 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index e8dad57..5097c3a 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -991,8 +991,8 @@ chgproccnt(uip, diff, max) int chgsbsize(uip, hiwat, to, max) struct uidinfo *uip; - u_long *hiwat; - u_long to; + u_int *hiwat; + u_int to; rlim_t max; { rlim_t new; diff --git a/sys/sys/param.h b/sys/sys/param.h index 9f9d1f7..e45a6ea 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -55,7 +55,7 @@ * doc/en_US.ISO8859-1/books/porters-handbook/book.sgml */ #undef __FreeBSD_version -#define __FreeBSD_version 500037 /* Master, propagated to newvers */ +#define __FreeBSD_version 500038 /* Master, propagated to newvers */ #ifndef NULL #define NULL 0 diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h index 8344c91..e9dff02 100644 --- a/sys/sys/resourcevar.h +++ b/sys/sys/resourcevar.h @@ -111,7 +111,7 @@ void addupc_task(struct kse *ke, uintptr_t pc, u_int ticks); void calcru(struct proc *p, struct timeval *up, struct timeval *sp, struct timeval *ip); int chgproccnt(struct uidinfo *uip, int diff, int max); -int chgsbsize(struct uidinfo *uip, u_long *hiwat, u_long to, +int chgsbsize(struct uidinfo *uip, u_int *hiwat, u_int to, rlim_t max); int fuswintr(void *base); struct plimit diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 357077c..7ef2dd3 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -98,15 +98,15 @@ struct socket { * Variables for socket buffering. */ struct sockbuf { - u_long sb_cc; /* actual chars in buffer */ - u_long sb_hiwat; /* max actual char count */ - u_long sb_mbcnt; /* chars of mbufs used */ - u_long sb_mbmax; /* max chars of mbufs to use */ - long sb_lowat; /* low water mark */ - struct mbuf *sb_mb; /* the mbuf chain */ struct selinfo sb_sel; /* process selecting read/write */ + struct mbuf *sb_mb; /* the mbuf chain */ + u_int sb_cc; /* actual chars in buffer */ + u_int sb_hiwat; /* max actual char count */ + u_int sb_mbcnt; /* chars of mbufs used */ + u_int sb_mbmax; /* max chars of mbufs to use */ + int sb_lowat; /* low water mark */ + int sb_timeo; /* timeout for read/write */ short sb_flags; /* flags, see below */ - short sb_timeo; /* timeout for read/write */ } so_rcv, so_snd; #define SB_MAX (256*1024) /* default for max chars in sockbuf */ #define SB_LOCK 0x01 /* lock on data queue */ @@ -172,13 +172,13 @@ struct xsocket { pid_t so_pgid; u_long so_oobmark; struct xsockbuf { - u_long sb_cc; - u_long sb_hiwat; - u_long sb_mbcnt; - u_long sb_mbmax; - long sb_lowat; + u_int sb_cc; + u_int sb_hiwat; + u_int sb_mbcnt; + u_int sb_mbmax; + int sb_lowat; + int sb_timeo; short sb_flags; - short sb_timeo; } so_rcv, so_snd; uid_t so_uid; /* XXX */ }; |