Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2004 21:10:38 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 54523 for review
Message-ID:  <200406092110.i59LAcm4045470@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54523

Change 54523 by peter@peter_daintree on 2004/06/09 21:09:53

	IFC @54520

Affected files ...

.. //depot/projects/hammer/bin/ls/ls.c#12 integrate
.. //depot/projects/hammer/bin/ls/print.c#14 integrate
.. //depot/projects/hammer/contrib/cvs/FREEBSD-Xlist#1 branch
.. //depot/projects/hammer/etc/rc.d/preseedrandom#3 integrate
.. //depot/projects/hammer/lib/libc/gen/fts.c#7 integrate
.. //depot/projects/hammer/lib/libc/stdio/fvwrite.c#3 integrate
.. //depot/projects/hammer/lib/libc/stdio/local.h#11 integrate
.. //depot/projects/hammer/lib/libc/stdio/vfprintf.c#15 integrate
.. //depot/projects/hammer/lib/libc/stdio/vfwprintf.c#14 integrate
.. //depot/projects/hammer/lib/libc/stdio/wbuf.c#3 integrate
.. //depot/projects/hammer/lib/libc/stdio/wsetup.c#2 integrate
.. //depot/projects/hammer/lib/libc/stdtime/localtime.c#4 integrate
.. //depot/projects/hammer/lib/libkvm/kvm.c#5 integrate
.. //depot/projects/hammer/lib/libvgl/main.c#2 integrate
.. //depot/projects/hammer/lib/msun/src/math.h#14 integrate
.. //depot/projects/hammer/release/doc/en_US.ISO8859-1/installation/common/artheader.sgml#3 integrate
.. //depot/projects/hammer/sbin/ipfw/ipfw.8#23 integrate
.. //depot/projects/hammer/sbin/ipfw/ipfw2.c#25 integrate
.. //depot/projects/hammer/share/examples/kld/cdev/module/cdev.c#2 integrate
.. //depot/projects/hammer/share/man/man4/bge.4#8 integrate
.. //depot/projects/hammer/share/man/man9/ifnet.9#13 integrate
.. //depot/projects/hammer/sys/amd64/amd64/pmap.c#78 integrate
.. //depot/projects/hammer/sys/conf/files#60 integrate
.. //depot/projects/hammer/sys/conf/kmod.mk#28 integrate
.. //depot/projects/hammer/sys/contrib/ipfilter/netinet/ip_compat.h#5 integrate
.. //depot/projects/hammer/sys/dev/bge/if_bge.c#32 integrate
.. //depot/projects/hammer/sys/dev/bge/if_bgereg.h#17 integrate
.. //depot/projects/hammer/sys/dev/cx/if_cx.c#6 integrate
.. //depot/projects/hammer/sys/dev/ed/if_ed.c#18 integrate
.. //depot/projects/hammer/sys/dev/eisa/eisa_if.m#1 branch
.. //depot/projects/hammer/sys/dev/eisa/eisaconf.c#6 integrate
.. //depot/projects/hammer/sys/dev/eisa/eisaconf.h#3 integrate
.. //depot/projects/hammer/sys/dev/fe/if_fe.c#13 integrate
.. //depot/projects/hammer/sys/dev/gem/if_gem.c#13 integrate
.. //depot/projects/hammer/sys/dev/hme/if_hme.c#11 integrate
.. //depot/projects/hammer/sys/dev/lge/if_lge.c#16 integrate
.. //depot/projects/hammer/sys/dev/lnc/if_lnc.c#16 integrate
.. //depot/projects/hammer/sys/dev/my/if_my.c#15 integrate
.. //depot/projects/hammer/sys/dev/nge/if_nge.c#18 integrate
.. //depot/projects/hammer/sys/dev/re/if_re.c#14 integrate
.. //depot/projects/hammer/sys/dev/sab/sab.c#13 integrate
.. //depot/projects/hammer/sys/dev/sn/if_sn.c#16 integrate
.. //depot/projects/hammer/sys/dev/tx/if_tx.c#16 integrate
.. //depot/projects/hammer/sys/dev/usb/if_aue.c#18 integrate
.. //depot/projects/hammer/sys/dev/usb/if_axe.c#12 integrate
.. //depot/projects/hammer/sys/dev/usb/if_cue.c#17 integrate
.. //depot/projects/hammer/sys/dev/usb/if_rue.c#11 integrate
.. //depot/projects/hammer/sys/dev/usb/if_udav.c#3 integrate
.. //depot/projects/hammer/sys/dev/wi/if_wi_pccard.c#21 integrate
.. //depot/projects/hammer/sys/dev/xe/if_xe.c#17 integrate
.. //depot/projects/hammer/sys/geom/geom_io.c#22 integrate
.. //depot/projects/hammer/sys/kern/kern_exit.c#28 integrate
.. //depot/projects/hammer/sys/kern/kern_proc.c#29 integrate
.. //depot/projects/hammer/sys/kern/kern_thread.c#51 integrate
.. //depot/projects/hammer/sys/kern/tty.c#15 integrate
.. //depot/projects/hammer/sys/kern/tty_pty.c#13 integrate
.. //depot/projects/hammer/sys/kern/uipc_mbuf.c#17 integrate
.. //depot/projects/hammer/sys/kern/uipc_socket.c#24 integrate
.. //depot/projects/hammer/sys/modules/em/Makefile#3 integrate
.. //depot/projects/hammer/sys/modules/ipfilter/Makefile#4 integrate
.. //depot/projects/hammer/sys/modules/ixgb/Makefile#2 integrate
.. //depot/projects/hammer/sys/net/netisr.h#5 integrate
.. //depot/projects/hammer/sys/net/rtsock.c#13 integrate
.. //depot/projects/hammer/sys/netatm/atm_ioctl.h#5 integrate
.. //depot/projects/hammer/sys/netinet/in.h#11 integrate
.. //depot/projects/hammer/sys/netinet/ip_fw.h#11 integrate
.. //depot/projects/hammer/sys/netinet/ip_fw2.c#28 integrate
.. //depot/projects/hammer/sys/netinet/raw_ip.c#21 integrate
.. //depot/projects/hammer/sys/pci/if_dc.c#34 integrate
.. //depot/projects/hammer/sys/pci/if_de.c#15 integrate
.. //depot/projects/hammer/sys/pci/if_pcn.c#19 integrate
.. //depot/projects/hammer/sys/pci/if_rl.c#34 integrate
.. //depot/projects/hammer/sys/pci/if_sf.c#20 integrate
.. //depot/projects/hammer/sys/pci/if_sis.c#27 integrate
.. //depot/projects/hammer/sys/pci/if_sk.c#27 integrate
.. //depot/projects/hammer/sys/pci/if_ste.c#26 integrate
.. //depot/projects/hammer/sys/pci/if_vr.c#21 integrate
.. //depot/projects/hammer/sys/pci/if_wb.c#19 integrate
.. //depot/projects/hammer/sys/pci/if_xl.c#37 integrate
.. //depot/projects/hammer/sys/sys/mbuf.h#24 integrate
.. //depot/projects/hammer/sys/sys/tty.h#7 integrate
.. //depot/projects/hammer/sys/sys/vmmeter.h#4 integrate
.. //depot/projects/hammer/sys/ufs/ffs/ffs_snapshot.c#19 integrate
.. //depot/projects/hammer/sys/vm/uma_core.c#25 integrate
.. //depot/projects/hammer/usr.sbin/adduser/rmuser.8#3 integrate
.. //depot/projects/hammer/usr.sbin/arp/arp.c#6 integrate
.. //depot/projects/hammer/usr.sbin/bootparamd/bootparamd/main.c#2 integrate
.. //depot/projects/hammer/usr.sbin/pstat/pstat.c#9 integrate
.. //depot/projects/hammer/usr.sbin/traceroute6/traceroute6.8#4 integrate

Differences ...

==== //depot/projects/hammer/bin/ls/ls.c#12 (text+ko) ====

@@ -42,7 +42,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ls/ls.c,v 1.77 2004/06/03 15:04:00 le Exp $");
+__FBSDID("$FreeBSD: src/bin/ls/ls.c,v 1.78 2004/06/08 09:30:10 das Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -452,7 +452,13 @@
 	    fts_open(argv, options, f_nosort ? NULL : mastercmp)) == NULL)
 		err(1, "fts_open");
 
-	display(NULL, fts_children(ftsp, 0), options);
+	/*
+	 * We ignore errors from fts_children here since they will be
+	 * replicated and signalled on the next call to fts_read() below.
+	 */
+	chp = fts_children(ftsp, 0);
+	if (chp != NULL)
+		display(NULL, chp, options);
 	if (f_listdir)
 		return;
 
@@ -533,16 +539,6 @@
 	char ngroup[STRBUF_SIZEOF(uid_t) + 1];
 	char nuser[STRBUF_SIZEOF(gid_t) + 1];
 
-	/*
-	 * If list is NULL there are two possibilities: that the parent
-	 * directory p has no children, or that fts_children() returned an
-	 * error.  We ignore the error case since it will be replicated
-	 * on the next call to fts_read() on the post-order visit to the
-	 * directory p, and will be signaled in traverse().
-	 */
-	if (list == NULL)
-		return;
-
 	needstats = f_inode || f_longform || f_size;
 	flen = 0;
 	btotal = 0;
@@ -784,7 +780,13 @@
 		++entries;
 	}
 
-	if (!entries)
+	/*
+	 * If there are no entries to display, we normally stop right
+	 * here.  However, we must continue if we have to display the
+	 * total block count.  In this case, we display the total only
+	 * on the second (p != NULL) pass.
+	 */
+	if (!entries && (!(f_longform || f_size) || p == NULL))
 		return;
 
 	d.list = list;

==== //depot/projects/hammer/bin/ls/print.c#14 (text+ko) ====

@@ -36,7 +36,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ls/print.c,v 1.72 2004/05/25 14:53:47 pjd Exp $");
+__FBSDID("$FreeBSD: src/bin/ls/print.c,v 1.73 2004/06/08 09:27:42 das Exp $");
 
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -142,8 +142,10 @@
 	int haveacls;
 	dev_t prevdev;
 
-	if (dp->list->fts_level != FTS_ROOTLEVEL && (f_longform || f_size))
+	if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) &&
+	    (f_longform || f_size)) {
 		(void)printf("total %lu\n", howmany(dp->btotal, blocksize));
+	}
 
 	haveacls = 1;
 	prevdev = (dev_t)-1;
@@ -294,8 +296,10 @@
 	if (num % numcols)
 		++numrows;
 
-	if (dp->list->fts_level != FTS_ROOTLEVEL && (f_longform || f_size))
+	if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) &&
+	    (f_longform || f_size)) {
 		(void)printf("total %lu\n", howmany(dp->btotal, blocksize));
+	}
 
 	base = 0;
 	for (row = 0; row < numrows; ++row) {

==== //depot/projects/hammer/etc/rc.d/preseedrandom#3 (text+ko) ====

@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $FreeBSD: src/etc/rc.d/preseedrandom,v 1.3 2004/06/07 09:16:19 obrien Exp $
+# $FreeBSD: src/etc/rc.d/preseedrandom,v 1.4 2004/06/08 19:53:25 obrien Exp $
 #
 
 # PROVIDE: preseedrandom
@@ -30,7 +30,7 @@
 	# First pass at reseeding /dev/random.
 	#
 	if [ -w /dev/random ]; then
-		feed_dev_random ${entropy_file}
+		feed_dev_random "/entropy"
 	fi
 
 	echo -n ' kickstart'

==== //depot/projects/hammer/lib/libc/gen/fts.c#7 (text+ko) ====

@@ -40,7 +40,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/fts.c,v 1.26 2004/05/13 15:59:38 bde Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/fts.c,v 1.27 2004/06/08 06:23:23 das Exp $");
 
 #include "namespace.h"
 #include <sys/param.h>
@@ -710,8 +710,6 @@
 			cur->fts_flags |= FTS_DONTCHDIR;
 			descend = 0;
 			cderrno = errno;
-			(void)closedir(dirp);
-			dirp = NULL;
 		} else
 			descend = 1;
 	} else

==== //depot/projects/hammer/lib/libc/stdio/fvwrite.c#3 (text+ko) ====

@@ -38,9 +38,8 @@
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/fvwrite.c,v 1.16 2004/03/02 19:43:51 jkh Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/fvwrite.c,v 1.17 2004/06/08 05:45:48 das Exp $");
 
-#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -68,10 +67,8 @@
 	if ((len = uio->uio_resid) == 0)
 		return (0);
 	/* make sure we can write */
-	if (cantwrite(fp)) {
-		errno = EBADF;
+	if (prepwrite(fp) != 0)
 		return (EOF);
-	}
 
 #define	MIN(a, b) ((a) < (b) ? (a) : (b))
 #define	COPY(n)	  (void)memcpy((void *)fp->_p, (void *)p, (size_t)(n))

==== //depot/projects/hammer/lib/libc/stdio/local.h#11 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)local.h	8.3 (Berkeley) 7/3/94
- * $FreeBSD: src/lib/libc/stdio/local.h,v 1.24 2004/05/22 15:19:41 tjr Exp $
+ * $FreeBSD: src/lib/libc/stdio/local.h,v 1.25 2004/06/08 05:45:32 das Exp $
  */
 
 #include <sys/types.h>	/* for off_t */
@@ -93,9 +93,10 @@
 };
 
 /*
- * Return true iff the given FILE cannot be written now.
+ * Prepare the given FILE for writing, and return 0 iff it
+ * can be written now.  Otherwise, return EOF and set errno.
  */
-#define	cantwrite(fp) \
+#define	prepwrite(fp) \
  	((((fp)->_flags & __SWR) == 0 || \
  	    ((fp)->_bf._base == NULL && ((fp)->_flags & __SSTR) == 0)) && \
 	 __swsetup(fp))

==== //depot/projects/hammer/lib/libc/stdio/vfprintf.c#15 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)vfprintf.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.65 2004/05/02 10:55:05 das Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.67 2004/06/08 12:03:48 stefanf Exp $");
 
 /*
  * Actual printf innards.
@@ -642,7 +642,7 @@
 	decimal_point = localeconv()->decimal_point;
 #endif
 	/* sorry, fprintf(read_only_file, "") returns EOF, not 0 */
-	if (cantwrite(fp))
+	if (prepwrite(fp) != 0)
 		return (EOF);
 
 	/* optimise fprintf(stderr) (and other unbuffered Unix files) */
@@ -1273,7 +1273,7 @@
 	 */
 #define ADDTYPE(type) \
 	((nextarg >= tablesize) ? \
-		__grow_type_table(nextarg, &typetable, &tablesize) : 0, \
+		__grow_type_table(nextarg, &typetable, &tablesize) : (void)0, \
 	(nextarg > tablemax) ? tablemax = nextarg : 0, \
 	typetable[nextarg++] = type)
 

==== //depot/projects/hammer/lib/libc/stdio/vfwprintf.c#14 (text+ko) ====

@@ -40,7 +40,7 @@
 #endif /* LIBC_SCCS and not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.20 2004/05/02 20:09:14 obrien Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.22 2004/06/08 12:03:48 stefanf Exp $");
 
 /*
  * Actual wprintf innards.
@@ -648,7 +648,7 @@
 #endif
 	convbuf = NULL;
 	/* sorry, fwprintf(read_only_file, L"") returns WEOF, not 0 */
-	if (cantwrite(fp))
+	if (prepwrite(fp) != 0)
 		return (EOF);
 
 	/* optimise fprintf(stderr) (and other unbuffered Unix files) */
@@ -1268,7 +1268,7 @@
 	 */
 #define ADDTYPE(type) \
 	((nextarg >= tablesize) ? \
-		__grow_type_table(nextarg, &typetable, &tablesize) : 0, \
+		__grow_type_table(nextarg, &typetable, &tablesize) : (void)0, \
 	(nextarg > tablemax) ? tablemax = nextarg : 0, \
 	typetable[nextarg++] = type)
 

==== //depot/projects/hammer/lib/libc/stdio/wbuf.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)wbuf.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.10 2002/08/13 09:30:41 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.11 2004/06/08 05:45:32 das Exp $");
 
 #include <stdio.h>
 #include "local.h"
@@ -65,7 +65,7 @@
 	 * calls might wrap _w from negative to positive.
 	 */
 	fp->_w = fp->_lbfsize;
-	if (cantwrite(fp))
+	if (prepwrite(fp) != 0)
 		return (EOF);
 	c = (unsigned char)c;
 

==== //depot/projects/hammer/lib/libc/stdio/wsetup.c#2 (text+ko) ====

@@ -38,8 +38,9 @@
 static char sccsid[] = "@(#)wsetup.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/wsetup.c,v 1.8 2002/03/22 21:53:04 obrien Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/wsetup.c,v 1.9 2004/06/08 05:44:52 das Exp $");
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "local.h"
@@ -47,7 +48,7 @@
 /*
  * Various output routines call wsetup to be sure it is safe to write,
  * because either _flags does not include __SWR, or _buf is NULL.
- * _wsetup returns 0 if OK to write, nonzero otherwise.
+ * _wsetup returns 0 if OK to write; otherwise, it returns EOF and sets errno.
  */
 int
 __swsetup(fp)
@@ -61,8 +62,10 @@
 	 * If we are not writing, we had better be reading and writing.
 	 */
 	if ((fp->_flags & __SWR) == 0) {
-		if ((fp->_flags & __SRW) == 0)
+		if ((fp->_flags & __SRW) == 0) {
+			errno = EBADF;
 			return (EOF);
+		}
 		if (fp->_flags & __SRD) {
 			/* clobber any ungetc data */
 			if (HASUB(fp))

==== //depot/projects/hammer/lib/libc/stdtime/localtime.c#4 (text+ko) ====

@@ -9,7 +9,7 @@
 static char	elsieid[] __unused = "@(#)localtime.c	7.57";
 #endif /* !defined NOID */
 #endif /* !defined lint */
-__FBSDID("$FreeBSD: src/lib/libc/stdtime/localtime.c,v 1.36 2003/02/16 17:29:11 nectar Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdtime/localtime.c,v 1.37 2004/06/08 12:20:40 stefanf Exp $");
 
 /*
 ** Leap second handling from Bradley White (bww@k.gp.cs.cmu.edu).
@@ -1508,12 +1508,7 @@
 		** It's okay to guess wrong since the guess
 		** gets checked.
 		*/
-		/*
-		** The (void *) casts are the benefit of SunOS 3.3 on Sun 2's.
-		*/
-		sp = (const struct state *)
-			(((void *) funcp == (void *) localsub) ?
-			lclptr : gmtptr);
+		sp = (funcp == localsub) ? lclptr : gmtptr;
 #ifdef ALL_STATE
 		if (sp == NULL)
 			return WRONG;
@@ -1583,11 +1578,7 @@
 	** We try to divine the type they started from and adjust to the
 	** type they need.
 	*/
-	/*
-	** The (void *) casts are the benefit of SunOS 3.3 on Sun 2's.
-	*/
-	sp = (const struct state *) (((void *) funcp == (void *) localsub) ?
-		lclptr : gmtptr);
+	sp = (funcp == localsub) ? lclptr : gmtptr;
 #ifdef ALL_STATE
 	if (sp == NULL)
 		return WRONG;

==== //depot/projects/hammer/lib/libkvm/kvm.c#5 (text+ko) ====

@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libkvm/kvm.c,v 1.25 2003/10/29 14:02:16 simokawa Exp $");
+__FBSDID("$FreeBSD: src/lib/libkvm/kvm.c,v 1.26 2004/06/08 13:08:19 stefanf Exp $");
 
 #if defined(LIBC_SCCS) && !defined(lint)
 #if 0
@@ -347,7 +347,7 @@
 	size_t len;
 {
 	int cc;
-	void *cp;
+	char *cp;
 
 	if (ISALIVE(kd)) {
 		/*
@@ -394,11 +394,11 @@
 			 */
 			if (cc == 0)
 				break;
-			(char *)cp += cc;
+			cp += cc;
 			kva += cc;
 			len -= cc;
 		}
-		return ((char *)cp - (char *)buf);
+		return (cp - (char *)buf);
 	}
 	/* NOTREACHED */
 }

==== //depot/projects/hammer/lib/libvgl/main.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libvgl/main.c,v 1.14 2002/06/02 20:05:39 schweikh Exp $");
+__FBSDID("$FreeBSD: src/lib/libvgl/main.c,v 1.15 2004/06/08 12:24:47 stefanf Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -105,7 +105,7 @@
 }
 
 static void 
-VGLAbort()
+VGLAbort(int arg __unused)
 {
   VGLAbortPending = 1;
   signal(SIGINT, SIG_IGN);
@@ -116,7 +116,7 @@
 }
 
 static void
-VGLSwitch()
+VGLSwitch(int arg __unused)
 {
   if (!VGLOnDisplay)
     VGLOnDisplay = 1;

==== //depot/projects/hammer/lib/msun/src/math.h#14 (text+ko) ====

@@ -11,12 +11,13 @@
 
 /*
  * from: @(#)fdlibm.h 5.1 93/09/24
- * $FreeBSD: src/lib/msun/src/math.h,v 1.33 2004/06/07 08:05:36 das Exp $
+ * $FreeBSD: src/lib/msun/src/math.h,v 1.34 2004/06/09 10:32:05 das Exp $
  */
 
 #ifndef _MATH_H_
 #define	_MATH_H_
 
+#include <sys/cdefs.h>
 #include <sys/_types.h>
 
 /*
@@ -150,8 +151,6 @@
 
 #endif /* __BSD_VISIBLE */
 
-#include <sys/cdefs.h>
-
 /*
  * Most of these functions have the side effect of setting errno, so they
  * are not declared as __pure2.  (XXX: this point needs to be revisited,

==== //depot/projects/hammer/release/doc/en_US.ISO8859-1/installation/common/artheader.sgml#3 (text+ko) ====

@@ -1,4 +1,4 @@
-<!-- $FreeBSD: src/release/doc/en_US.ISO8859-1/installation/common/artheader.sgml,v 1.4 2003/01/06 21:59:16 bmah Exp $ -->
+<!-- $FreeBSD: src/release/doc/en_US.ISO8859-1/installation/common/artheader.sgml,v 1.5 2004/06/09 10:56:32 den Exp $ -->
 
 <articleinfo>
   <title>&os;/&arch; &release.current; Installation Instructions</title>
@@ -12,6 +12,7 @@
     <year>2001</year>
     <year>2002</year>
     <year>2003</year>
+    <year>2004</year>
     <holder role="mailto:doc@FreeBSD.org">The FreeBSD Documentation Project</holder>
   </copyright>
 </articleinfo>

==== //depot/projects/hammer/sbin/ipfw/ipfw.8#23 (text+ko) ====

@@ -1,7 +1,7 @@
 .\"
-.\" $FreeBSD: src/sbin/ipfw/ipfw.8,v 1.144 2004/05/23 19:05:59 maxim Exp $
+.\" $FreeBSD: src/sbin/ipfw/ipfw.8,v 1.145 2004/06/09 20:10:37 ru Exp $
 .\"
-.Dd December 1, 2003
+.Dd June 9, 2004
 .Dt IPFW 8
 .Os
 .Sh NAME
@@ -43,6 +43,15 @@
 .Cm set show
 .Pp
 .Nm
+.Cm table Ar number Cm add Ar addr Ns Oo / Ns Ar masklen Oc Op Ar value
+.Nm
+.Cm table Ar number Cm delete Ar addr Ns Op / Ns Ar masklen
+.Nm
+.Cm table Ar number Cm flush
+.Nm
+.Cm table Ar number Cm list
+.Pp
+.Nm
 .Brq Cm pipe | queue
 .Ar number
 .Cm config
@@ -758,13 +767,26 @@
 .Em or-block
 with multiple addresses) is provided for convenience only and
 its use is discouraged.
-.It Ar addr : Oo Cm not Oc Brq Cm any | me | Ar addr-list | Ar addr-set
+.It Ar addr : Oo Cm not Oc Bro
+.Cm any | me |
+.Cm table Ns Pq Ar number Ns Op , Ns Ar value
+.Ar | addr-list | addr-set
+.Brc
 .It Cm any
 matches any IP address.
 .It Cm me
 matches any IP address configured on an interface in the system.
 The address list is evaluated at the time the packet is
 analysed.
+.It Cm table Ns Pq Ar number Ns Op , Ns Ar value
+Matches any IP address for which an entry exists in the lookup table
+.Ar number .
+If an optional 32-bit unsigned
+.Ar value
+is also specified, an entry will match only if it has this value.
+See the
+.Sx LOOKUP TABLES
+section below for more information on lookup tables.
 .It Ar addr-list : ip-addr Ns Op Ns , Ns Ar addr-list
 .It Ar ip-addr :
 A host or subnet address specified in one of the following ways:
@@ -1248,6 +1270,43 @@
 This option can be used to make anti-spoofing rules to reject all
 packets whose source address is unreachable.
 .El
+.Sh LOOKUP TABLES
+Lookup tables are useful to handle large sparse address sets,
+typically from a hundred to several thousands of entries.
+There could be 128 different lookup tables, numbered 0 to 127.
+.Pp
+Each entry is represented by an
+.Ar addr Ns Op / Ns Ar masklen
+and will match all addresses with base
+.Ar addr
+(specified as a dotted quad or a hostname)
+and mask width of
+.Ar masklen
+bits.
+If
+.Ar masklen
+is not specified, it defaults to 32.
+When looking up an IP address in a table, the most specific
+entry will match.
+Associated with each entry is a 32-bit unsigned
+.Ar value ,
+which can optionally be checked by a rule matching code.
+When adding an entry, if
+.Ar value
+is not specified, it defaults to 0.
+.Pp
+An entry can be added to a table
+.Pq Cm add ,
+removed from a table
+.Pq Cm delete ,
+a table can be examined
+.Pq Cm list
+or flushed
+.Pq Cm flush .
+.Pp
+Internally, each table is stored in a Radix tree, the same way as
+the routing table (see
+.Xr route 4 ) .
 .Sh SETS OF RULES
 Each rule belongs to one of 32 different
 .Em sets

==== //depot/projects/hammer/sbin/ipfw/ipfw2.c#25 (text+ko) ====

@@ -17,7 +17,7 @@
  *
  * NEW command line interface for IP firewall facility
  *
- * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.50 2004/06/02 21:12:55 csjp Exp $
+ * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.51 2004/06/09 20:10:37 ru Exp $
  */
 
 #include <sys/param.h>
@@ -385,7 +385,8 @@
 		err(EX_UNAVAILABLE, "socket");
 
 	if (optname == IP_FW_GET || optname == IP_DUMMYNET_GET ||
-	    optname == IP_FW_ADD)
+	    optname == IP_FW_ADD || optname == IP_FW_TABLE_LIST ||
+	    optname == IP_FW_TABLE_GETSIZE)
 		i = getsockopt(s, IPPROTO_IP, optname, optval,
 			(socklen_t *)optlen);
 	else
@@ -714,6 +715,14 @@
 		printf("me");
 		return;
 	}
+	if (cmd->o.opcode == O_IP_SRC_LOOKUP ||
+	    cmd->o.opcode == O_IP_DST_LOOKUP) {
+		printf("table(%u", ((ipfw_insn *)cmd)->arg1);
+		if (len == F_INSN_SIZE(ipfw_insn_u32))
+			printf(",%u", *a);
+		printf(")");
+		return;
+	}
 	if (cmd->o.opcode == O_IP_SRC_SET || cmd->o.opcode == O_IP_DST_SET) {
 		uint32_t x, *map = (uint32_t *)&(cmd->mask);
 		int i, j;
@@ -1088,6 +1097,7 @@
 			break;
 
 		case O_IP_SRC:
+		case O_IP_SRC_LOOKUP:
 		case O_IP_SRC_MASK:
 		case O_IP_SRC_ME:
 		case O_IP_SRC_SET:
@@ -1102,6 +1112,7 @@
 			break;
 
 		case O_IP_DST:
+		case O_IP_DST_LOOKUP:
 		case O_IP_DST_MASK:
 		case O_IP_DST_ME:
 		case O_IP_DST_SET:
@@ -1870,13 +1881,14 @@
 "{pipe|queue} N config PIPE-BODY\n"
 "[pipe|queue] {zero|delete|show} [N{,N}]\n"
 "set [disable N... enable N...] | move [rule] X to Y | swap X Y | show\n"
+"table N {add ip[/bits] [value] | delete ip[/bits] | flush | list}\n"
 "\n"
 "RULE-BODY:	check-state [LOG] | ACTION [LOG] ADDR [OPTION_LIST]\n"
 "ACTION:	check-state | allow | count | deny | reject | skipto N |\n"
 "		{divert|tee} PORT | forward ADDR | pipe N | queue N\n"
 "ADDR:		[ MAC dst src ether_type ] \n"
 "		[ from IPADDR [ PORT ] to IPADDR [ PORTLIST ] ]\n"
-"IPADDR:	[not] { any | me | ip/bits{x,y,z} | IPLIST }\n"
+"IPADDR:	[not] { any | me | ip/bits{x,y,z} | table(t[,v]) | IPLIST }\n"
 "IPLIST:	{ ip | ip/bits | ip:mask }[,IPLIST]\n"
 "OPTION_LIST:	OPTION [OPTION_LIST]\n"
 "OPTION:	bridged | {dst-ip|src-ip} ADDR | {dst-port|src-port} LIST |\n"
@@ -1932,6 +1944,21 @@
 		return;
 	}
 
+	if (!strncmp(av, "table(", 6)) {
+		char *p = strchr(av + 6, ',');
+
+		if (p)
+			*p++ = '\0';
+		cmd->o.opcode = O_IP_DST_LOOKUP;
+		cmd->o.arg1 = strtoul(av + 6, NULL, 0);
+		if (p) {
+			cmd->o.len |= F_INSN_SIZE(ipfw_insn_u32);
+			d[0] = strtoul(p, NULL, 0);
+		} else
+			cmd->o.len |= F_INSN_SIZE(ipfw_insn);
+		return;
+	}
+
     while (av) {
 	/*
 	 * After the address we can have '/' or ':' indicating a mask,
@@ -2663,6 +2690,8 @@
 	fill_ip((ipfw_insn_ip *)cmd, av);
 	if (cmd->opcode == O_IP_DST_SET)			/* set */
 		cmd->opcode = O_IP_SRC_SET;
+	else if (cmd->opcode == O_IP_DST_LOOKUP)		/* table */
+		cmd->opcode = O_IP_SRC_LOOKUP;
 	else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn))		/* me */
 		cmd->opcode = O_IP_SRC_ME;
 	else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn_u32))	/* one IP */
@@ -2678,6 +2707,8 @@
 	fill_ip((ipfw_insn_ip *)cmd, av);
 	if (cmd->opcode == O_IP_DST_SET)			/* set */
 		;
+	else if (cmd->opcode == O_IP_DST_LOOKUP)		/* table */
+		;
 	else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn))		/* me */
 		cmd->opcode = O_IP_DST_ME;
 	else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn_u32))	/* one IP */
@@ -3593,6 +3624,79 @@
 }
 
 /*
+ * This one handles all table-related commands
+ * 	ipfw table N add addr[/masklen] [value]
+ * 	ipfw table N delete addr[/masklen]
+ * 	ipfw table N flush
+ * 	ipfw table N list
+ */
+static void
+table_handler(int ac, char *av[])
+{
+	ipfw_table_entry ent;
+	ipfw_table *tbl;
+	int do_add;
+	char *p;
+	socklen_t l;
+	uint32_t a;
+
+	ac--; av++;
+	if (ac && isdigit(**av)) {
+		ent.tbl = atoi(*av);
+		ac--; av++;
+	} else
+		errx(EX_USAGE, "table number required");
+	NEED1("table needs command");
+	if (strncmp(*av, "add", strlen(*av)) == 0 ||
+	    strncmp(*av, "delete", strlen(*av)) == 0) {
+		do_add = **av == 'a';
+		ac--; av++;
+		if (!ac)
+			errx(EX_USAGE, "IP address required");
+		p = strchr(*av, '/');
+		if (p) {
+			*p++ = '\0';
+			ent.masklen = atoi(p);
+			if (ent.masklen > 32)
+				errx(EX_DATAERR, "bad width ``%s''", p);
+		} else
+			ent.masklen = 32;
+		if (lookup_host(*av, (struct in_addr *)&ent.addr) != 0)
+			errx(EX_NOHOST, "hostname ``%s'' unknown", av);
+		ac--; av++;
+		if (do_add && ac)
+			ent.value = strtoul(*av, NULL, 0);
+		else
+			ent.value = 0;
+		if (do_cmd(do_add ? IP_FW_TABLE_ADD : IP_FW_TABLE_DEL,
+		    &ent, sizeof(ent)) < 0)
+			err(EX_OSERR, "setsockopt(IP_FW_TABLE_%s)",
+			    do_add ? "ADD" : "DEL");
+	} else if (strncmp(*av, "flush", strlen(*av)) == 0) {
+		if (do_cmd(IP_FW_TABLE_FLUSH, &ent.tbl, sizeof(ent.tbl)) < 0)
+			err(EX_OSERR, "setsockopt(IP_FW_TABLE_FLUSH)");
+	} else if (strncmp(*av, "list", strlen(*av)) == 0) {
+		a = ent.tbl;
+		l = sizeof(a);
+		if (do_cmd(IP_FW_TABLE_GETSIZE, &a, (uintptr_t)&l) < 0)
+			err(EX_OSERR, "getsockopt(IP_FW_TABLE_GETSIZE)");
+		l = sizeof(*tbl) + a * sizeof(ipfw_table_entry);
+		tbl = malloc(l);
+		if (tbl == NULL)
+			err(EX_OSERR, "malloc");
+		tbl->tbl = ent.tbl;
+		if (do_cmd(IP_FW_TABLE_LIST, tbl, (uintptr_t)&l) < 0)
+			err(EX_OSERR, "getsockopt(IP_FW_TABLE_LIST)");
+		for (a = 0; a < tbl->cnt; a++) {
+			printf("%s/%u %u\n",
+			    inet_ntoa(*(struct in_addr *)&tbl->ent[a].addr),
+			    tbl->ent[a].masklen, tbl->ent[a].value);
+		}
+	} else
+		errx(EX_USAGE, "invalid table command %s", *av);
+}
+
+/*
  * Called with the arguments (excluding program name).
  * Returns 0 if successful, 1 if empty command, errx() in case of errors.
  */
@@ -3822,6 +3926,8 @@
 		list(ac, av, do_acct);
 	else if (!strncmp(*av, "set", strlen(*av)))
 		sets_handler(ac, av);
+	else if (!strncmp(*av, "table", strlen(*av)))
+		table_handler(ac, av);
 	else if (!strncmp(*av, "enable", strlen(*av)))
 		sysctl_handler(ac, av, 1);
 	else if (!strncmp(*av, "disable", strlen(*av)))

==== //depot/projects/hammer/share/examples/kld/cdev/module/cdev.c#2 (text+ko) ====

@@ -65,15 +65,13 @@
  * SUCH DAMAGE.
  *
  *
- * $FreeBSD: src/share/examples/kld/cdev/module/cdev.c,v 1.5 2001/11/13 07:42:30 arr Exp $
+ * $FreeBSD: src/share/examples/kld/cdev/module/cdev.c,v 1.7 2004/06/09 17:10:41 maxim Exp $
  */
-#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/uio.h>
-#include <sys/param.h>
 #include <sys/proc.h>
 #include <sys/systm.h>
 #include <sys/ioccom.h>
-#include <sys/systm.h>
 #include <sys/conf.h>
 
 #include "cdev.h"
@@ -139,7 +137,7 @@
 	error = EINVAL;
 	break;
     }
-    return error;
+    return (error);
 }
 
 /*
@@ -162,7 +160,7 @@
 }
 
 /*
- * The mydev_read function just takes the buf that was saved 
+ * The mydev_read function just takes the buf that was saved
  * via mydev_write() and returns it to userland for
  * accessing.
  */
@@ -175,7 +173,7 @@
 	dev2udev(dev), uio, ioflag);
 
     if (len <= 0) {
-	err = -1; 
+	err = -1;
     } else {	/* copy buf to userland */
 	copystr(&buf, uio->uio_iov->iov_base, 513, &len);
     }

==== //depot/projects/hammer/share/man/man4/bge.4#8 (text+ko) ====

@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/bge.4,v 1.10 2004/05/28 21:16:13 simon Exp $
+.\" $FreeBSD: src/share/man/man4/bge.4,v 1.11 2004/06/08 17:36:17 brueffer Exp $
 .\"
 .Dd September 27, 2001
 .Dt BGE 4
@@ -85,7 +85,7 @@
 Additional features may be
 provided via value-add firmware updates.
 The BCM570x supports TBI (ten bit interface) and GMII
-transceivers, which means it can be used with either copper of 1000baseX
+transceivers, which means it can be used with either copper or 1000baseX
 fiber applications.
 Note however the device only supports a single
 speed in TBI mode.

==== //depot/projects/hammer/share/man/man9/ifnet.9#13 (text+ko) ====

@@ -26,8 +26,8 @@
 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man9/ifnet.9,v 1.39 2004/06/07 16:46:28 yar Exp $
-.Dd January 15, 1997
+.\" $FreeBSD: src/share/man/man9/ifnet.9,v 1.42 2004/06/08 09:54:53 yar Exp $
+.Dd June 8, 2004
 .Os
 .Dt IFNET 9
 .Sh NAME
@@ -413,6 +413,16 @@
 in this table; the latter are marked
 .Aq D .
 .Pp
+The macro
+.Dv IFF_CANTCHANGE
+defines the bits which cannot be set by a user program using the
+.Dv SIOCSIFFLAGS
+command to
+.Xr ioctl 2 ;
+these are indicated by an asterisk
+.Pq Ql *
+in the following listing.
+.Pp
 .Bl -tag -width ".Dv IFF_POINTOPOINT" -offset indent -compact
 .It Dv IFF_UP
 .Aq D
@@ -467,15 +477,15 @@
 .It Dv IFF_MULTICAST
 .Aq S*
 This interface supports multicast.
+.It Dv IFF_POLLING
+.Aq D*
+The interface is in
+.Xr polling 4
+mode.
+See
+.Sx Interface Capabilities Flags
+for details.
 .El
-.Pp
-The macro
-.Dv IFF_CANTCHANGE
-defines the bits which cannot be set by a user program using the
-.Dv SIOCSIFFLAGS
-command to
-.Xr ioctl 2 ;
-these are indicated by an asterisk in the listing above.
 .Ss "Interface Capabilities Flags"
 Interface capabilities are specialized features an interface may
 or may not support.
@@ -511,6 +521,10 @@
 .Bl -tag -width ".Dv IFCAP_VLAN_HWTAGGING" -offset indent
 .It Dv IFCAP_NETCONS
 This interface can be a network console.
+.It Dv IFCAP_POLLING
+This interface supports
+.Xr polling 4 .
+See below for details.
 .It Dv IFCAP_RXCSUM
 This interface can do checksum validation on receiving data.
 Some interfaces do not have sufficient buffer storage to store frames
@@ -587,6 +601,48 @@
 See
 .Xr mbuf 9
 for details.
+.Pp
+The capability of a network interface to operate in
+.Xr polling 4
+mode involves several flags in different
+global variables and per-interface fields.
+First, there is a system-wide
+.Xr sysctl 8
+master switch named
+.Va kern.polling.enable ,
+which can toggle
+.Xr polling 4
+globally.
+If that variable is set to non-zero,
+.Xr polling 4

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406092110.i59LAcm4045470>