summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authoralex <alex@FreeBSD.org>1998-10-04 17:20:22 +0000
committeralex <alex@FreeBSD.org>1998-10-04 17:20:22 +0000
commit8631c2109ac6c8971a6a7d7f042aee9d162669cc (patch)
tree2dc28a3d1e564ce11b811b14422440eae8c545c4 /sys/net
parent008b2cdf196fbeff162043b5d3fbc93fb4bb6d62 (diff)
downloadFreeBSD-src-8631c2109ac6c8971a6a7d7f042aee9d162669cc.zip
FreeBSD-src-8631c2109ac6c8971a6a7d7f042aee9d162669cc.tar.gz
Support hz > 1000 (Alpha) in BIOCSRTIMEOUT.
Obtained from: OpenBSD
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 63bca3b..de8f145 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -37,7 +37,7 @@
*
* @(#)bpf.c 8.2 (Berkeley) 3/28/94
*
- * $Id: bpf.c,v 1.40 1998/07/29 05:34:59 kjc Exp $
+ * $Id: bpf.c,v 1.41 1998/08/18 10:13:11 ache Exp $
*/
#include "bpfilter.h"
@@ -777,15 +777,10 @@ bpfioctl(dev, cmd, addr, flags, p)
case BIOCSRTIMEOUT:
{
struct timeval *tv = (struct timeval *)addr;
- u_long msec;
-
- /* Compute number of milliseconds. */
- msec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
- /* Scale milliseconds to ticks. Assume hard
- clock has millisecond or greater resolution
- (i.e. tick >= 1000). For 10ms hardclock,
- tick/1000 = 10, so rtout<-msec/10. */
- d->bd_rtout = msec / (tick / 1000);
+
+ d->bd_rtout = tv->tv_sec * hz + tv->tv_usec / tick;
+ if (d->bd_rtout == 0 && tv->tv_usec != 0)
+ d->bd_rtout = 1;
break;
}
OpenPOWER on IntegriCloud