Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Fix iplog problem on sparc64 [from Tomi Nylund]



details:   https://anonhg.NetBSD.org/src/rev/4d88d9ad8620
branches:  trunk
changeset: 533468:4d88d9ad8620
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 01 13:55:35 2002 +0000

description:
Fix iplog problem on sparc64 [from Tomi Nylund]
        1. size_t is 64 bits, so use a u_32_t for iplused
        2. microtime() and friends expect a struct timeval,
           passing the first of two unsigned longs will not cut it.

diffstat:

 sys/netinet/ip_fil.h |   7 +++----
 sys/netinet/ip_log.c |  14 +++++++-------
 2 files changed, 10 insertions(+), 11 deletions(-)

diffs (75 lines):

diff -r 0494ec18eff4 -r 4d88d9ad8620 sys/netinet/ip_fil.h
--- a/sys/netinet/ip_fil.h      Mon Jul 01 13:19:05 2002 +0000
+++ b/sys/netinet/ip_fil.h      Mon Jul 01 13:55:35 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil.h,v 1.44 2002/05/02 17:12:04 martti Exp $       */
+/*     $NetBSD: ip_fil.h,v 1.45 2002/07/01 13:55:35 christos Exp $     */
 
 /*
  * Copyright (C) 1993-2002 by Darren Reed.
@@ -416,8 +416,7 @@
 typedef        struct  iplog   {
        u_32_t  ipl_magic;
        u_int   ipl_count;
-       u_long  ipl_sec;
-       u_long  ipl_usec;
+       struct timeval  ipl_time;
        size_t  ipl_dsize;
        struct  iplog   *ipl_next;
 } iplog_t;
@@ -643,7 +642,7 @@
 extern fr_info_t       frcache[2];
 extern char    ipfilter_version[];
 extern iplog_t **iplh[IPL_LOGMAX+1], *iplt[IPL_LOGMAX+1];
-extern size_t  iplused[IPL_LOGMAX + 1];
+extern u_32_t  iplused[IPL_LOGMAX + 1];
 extern struct frentry *ipfilter[2][2], *ipacct[2][2];
 #ifdef USE_INET6
 extern struct frentry *ipfilter6[2][2], *ipacct6[2][2];
diff -r 0494ec18eff4 -r 4d88d9ad8620 sys/netinet/ip_log.c
--- a/sys/netinet/ip_log.c      Mon Jul 01 13:19:05 2002 +0000
+++ b/sys/netinet/ip_log.c      Mon Jul 01 13:55:35 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_log.c,v 1.20 2002/06/09 16:33:41 itojun Exp $       */
+/*     $NetBSD: ip_log.c,v 1.21 2002/07/01 13:55:35 christos Exp $     */
 
 /*
  * Copyright (C) 1997-2001 by Darren Reed.
@@ -9,7 +9,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_log.c,v 1.20 2002/06/09 16:33:41 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_log.c,v 1.21 2002/07/01 13:55:35 christos Exp $");
 
 #include <sys/param.h>
 #if defined(KERNEL) && !defined(_KERNEL)
@@ -133,7 +133,7 @@
 # endif
 
 iplog_t        **iplh[IPL_LOGMAX+1], *iplt[IPL_LOGMAX+1], *ipll[IPL_LOGMAX+1];
-size_t iplused[IPL_LOGMAX+1];
+u_32_t iplused[IPL_LOGMAX+1];
 static fr_info_t       iplcrc[IPL_LOGMAX+1];
 
 
@@ -340,15 +340,15 @@
        ipl->ipl_dsize = len;
 # ifdef _KERNEL
 #  if SOLARIS || defined(sun)
-       uniqtime((struct timeval *)&ipl->ipl_sec);
+       uniqtime(&ipl->ipl_time);
 #  else
 #   if BSD >= 199306 || defined(__FreeBSD__) || defined(__sgi)
-       microtime((struct timeval *)&ipl->ipl_sec);
+       microtime(&ipl->ipl_time);
 #   endif
 #  endif
 # else
-       ipl->ipl_sec = 0;
-       ipl->ipl_usec = 0;
+       ipl->ipl_time.tv_sec = 0;
+       ipl->ipl_time.tv_usec = 0;
 # endif
 
        /*



Home | Main Index | Thread Index | Old Index