Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Aug 2002 08:06:18 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 15382 for review
Message-ID:  <200208011506.g71F6IX0076665@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=15382

Change 15382 by rwatson@rwatson_paprika on 2002/08/01 08:05:27

	Integ from main tree, including various MAC changes, and other
	tree changes overnight, in preparation for more MAC merging.

Affected files ...

.. //depot/projects/trustedbsd/base/include/Makefile#11 integrate
.. //depot/projects/trustedbsd/base/include/cpio.h#1 branch
.. //depot/projects/trustedbsd/base/lib/libc/xdr/xdr_array.c#5 integrate
.. //depot/projects/trustedbsd/base/lib/libz/minigzip.c#3 integrate
.. //depot/projects/trustedbsd/base/sys/conf/kern.post.mk#13 integrate
.. //depot/projects/trustedbsd/base/sys/dev/wi/if_wi.c#20 integrate
.. //depot/projects/trustedbsd/base/sys/i386/acpica/acpi_wakeup.c#6 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_exec.c#17 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_exit.c#16 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_ktrace.c#9 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_shutdown.c#10 integrate
.. //depot/projects/trustedbsd/base/sys/kern/subr_mbuf.c#12 integrate
.. //depot/projects/trustedbsd/base/sys/kern/subr_taskqueue.c#4 integrate
.. //depot/projects/trustedbsd/base/sys/kern/uipc_socket.c#16 integrate
.. //depot/projects/trustedbsd/base/sys/kern/vfs_syscalls.c#22 integrate
.. //depot/projects/trustedbsd/base/sys/netinet/ip_icmp.c#8 integrate
.. //depot/projects/trustedbsd/base/sys/netinet/tcp_subr.c#13 integrate
.. //depot/projects/trustedbsd/base/usr.bin/sockstat/sockstat.c#2 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/sysinstall/doc.c#3 integrate

Differences ...

==== //depot/projects/trustedbsd/base/include/Makefile#11 (text+ko) ====

@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.2 (Berkeley) 1/4/94
-# $FreeBSD: src/include/Makefile,v 1.171 2002/06/17 01:42:33 wollman Exp $
+# $FreeBSD: src/include/Makefile,v 1.172 2002/08/01 07:18:38 mike Exp $
 #
 # Doing a make install builds /usr/include
 #
@@ -8,7 +8,7 @@
 
 CLEANFILES= osreldate.h version vers.c
 SUBDIR= arpa protocols rpcsvc rpc
-INCS=	a.out.h ar.h assert.h bitstring.h complex.h ctype.h db.h \
+INCS=	a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \
 	dirent.h \
 	dlfcn.h elf.h elf-hints.h err.h fnmatch.h fstab.h \
 	fts.h glob.h grp.h \

==== //depot/projects/trustedbsd/base/lib/libc/xdr/xdr_array.c#5 (text+ko) ====

@@ -34,7 +34,7 @@
 static char *sccsid = "@(#)xdr_array.c	2.1 88/07/29 4.0 RPCSRC";
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/xdr/xdr_array.c,v 1.13 2002/07/31 15:09:49 nectar Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/xdr/xdr_array.c,v 1.14 2002/08/01 12:23:04 nectar Exp $");
 
 /*
  * xdr_array.c, Generic XDR routines impelmentation.
@@ -83,7 +83,7 @@
 		return (FALSE);
 	}
 	c = *sizep;
-	if ((c > maxsize && UINT_MAX/elsize < c) &&
+	if ((c > maxsize || UINT_MAX/elsize < c) &&
 	    (xdrs->x_op != XDR_FREE)) {
 		return (FALSE);
 	}

==== //depot/projects/trustedbsd/base/lib/libz/minigzip.c#3 (text+ko) ====

@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libz/minigzip.c,v 1.11 2002/03/11 22:36:45 green Exp $");
+__FBSDID("$FreeBSD: src/lib/libz/minigzip.c,v 1.12 2002/08/01 11:29:05 markm Exp $");
 
 #include <stdio.h>
 #include "zlib.h"
@@ -235,7 +235,7 @@
     char *infile, *outfile;
     FILE  *out;
     gzFile in;
-    int len = strlen(file);
+    size_t len = strlen(file);
 
     if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
         fprintf(stderr, "%s: filename too long\n", prog);

==== //depot/projects/trustedbsd/base/sys/conf/kern.post.mk#13 (text+ko) ====

@@ -6,7 +6,7 @@
 # should be defined in the kern.pre.mk so that port makefiles can
 # override or augment them.
 #
-# $FreeBSD: src/sys/conf/kern.post.mk,v 1.24 2002/07/31 14:59:05 jake Exp $
+# $FreeBSD: src/sys/conf/kern.post.mk,v 1.25 2002/08/01 03:13:10 peter Exp $
 #
 
 # XXX why are only some phony targets marked phony?
@@ -208,9 +208,6 @@
 modules-install modules-reinstall:
 	cd $S/modules ; ${MKMODULESENV} ${MAKE} install
 
-modules-tags:
-	cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags
-
 config.o:
 	${NORMAL_C}
 

==== //depot/projects/trustedbsd/base/sys/dev/wi/if_wi.c#20 (text+ko) ====

@@ -103,7 +103,7 @@
 
 #if !defined(lint)
 static const char rcsid[] =
-  "$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.108 2002/07/29 15:36:22 imp Exp $";
+  "$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.109 2002/08/01 07:37:52 imp Exp $";
 #endif
 
 static void wi_intr(void *);
@@ -1655,19 +1655,22 @@
 		break;
 	case SIOCSIFFLAGS:
 		/*
-		 * Can't do promisc and hostap at the same time.
+		 * Can't do promisc and hostap at the same time.  If all that's
+		 * changing is the promisc flag, try to short-circuit a call to
+		 * wi_init() by just setting PROMISC in the hardware.
 		 */
-		if (sc->wi_ptype == WI_PORTTYPE_AP)
-			ifp->if_flags &= ~IFF_PROMISC;
 		if (ifp->if_flags & IFF_UP) {
-			if (ifp->if_flags & IFF_RUNNING &&
-			    ifp->if_flags & IFF_PROMISC &&
-			    !(sc->wi_if_flags & IFF_PROMISC)) {
-				WI_SETVAL(WI_RID_PROMISC, 1);
-			} else if (ifp->if_flags & IFF_RUNNING &&
-			    !(ifp->if_flags & IFF_PROMISC) &&
-			    sc->wi_if_flags & IFF_PROMISC) {
-				WI_SETVAL(WI_RID_PROMISC, 0);
+			if (sc->wi_ptype != WI_PORTTYPE_AP &&
+			    ifp->if_flags & IFF_RUNNING) {
+				if (ifp->if_flags & IFF_PROMISC &&
+				    !(sc->wi_if_flags & IFF_PROMISC)) {
+					WI_SETVAL(WI_RID_PROMISC, 1);
+				} else if (!(ifp->if_flags & IFF_PROMISC) &&
+				    sc->wi_if_flags & IFF_PROMISC) {
+					WI_SETVAL(WI_RID_PROMISC, 0);
+				} else {
+					wi_init(sc);
+				}
 			} else {
 				wi_init(sc);
 			}
@@ -2091,12 +2094,7 @@
 	 *      and always reset promisc mode in Host-AP regime,
 	 *      it shows us all the packets anyway.
 	 */
-	/*
-	 * Can't do promisc and hostap at the same time.
-	 */
-	if (sc->wi_ptype == WI_PORTTYPE_AP)
-		ifp->if_flags &= ~IFF_PROMISC;
-	if (ifp->if_flags & IFF_PROMISC)
+	if (sc->wi_ptype != WI_PORTTYPE_AP && ifp->if_flags & IFF_PROMISC)
 		WI_SETVAL(WI_RID_PROMISC, 1);
 	else
 		WI_SETVAL(WI_RID_PROMISC, 0);

==== //depot/projects/trustedbsd/base/sys/i386/acpica/acpi_wakeup.c#6 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *      $FreeBSD: src/sys/i386/acpica/acpi_wakeup.c,v 1.10 2002/05/19 06:42:29 peter Exp $
+ *      $FreeBSD: src/sys/i386/acpica/acpi_wakeup.c,v 1.11 2002/08/01 09:48:01 iwasaki Exp $
  */
 
 #include <sys/param.h>
@@ -93,6 +93,7 @@
 	movl	r_esi,%esi		\n\
 	movl	r_edi,%edi		\n\
 	movl	r_esp,%esp		\n\
+	popl	%eax			\n\
 					\n\
 	pushl	r_efl			\n\
 	popfl				\n\

==== //depot/projects/trustedbsd/base/sys/kern/kern_exec.c#17 (text+ko) ====

@@ -23,10 +23,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/kern/kern_exec.c,v 1.178 2002/07/30 15:38:29 nectar Exp $
+ * $FreeBSD: src/sys/kern/kern_exec.c,v 1.179 2002/08/01 14:31:58 rwatson Exp $
  */
 
 #include "opt_ktrace.h"
+#include "opt_mac.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -35,6 +36,7 @@
 #include <sys/sysproto.h>
 #include <sys/signalvar.h>
 #include <sys/kernel.h>
+#include <sys/mac.h>
 #include <sys/mount.h>
 #include <sys/filedesc.h>
 #include <sys/fcntl.h>
@@ -909,6 +911,13 @@
 	int error;
 
 	td = curthread;			/* XXXKSE */
+
+#ifdef MAC
+	error = mac_check_vnode_exec(td->td_ucred, imgp->vp);
+	if (error)
+		return (error);
+#endif
+	
 	/* Get file attributes */
 	error = VOP_GETATTR(vp, attr, td->td_ucred, td);
 	if (error)

==== //depot/projects/trustedbsd/base/sys/kern/kern_exit.c#16 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_exit.c	8.7 (Berkeley) 2/12/94
- * $FreeBSD: src/sys/kern/kern_exit.c,v 1.170 2002/06/29 17:26:18 julian Exp $
+ * $FreeBSD: src/sys/kern/kern_exit.c,v 1.172 2002/08/01 13:44:33 jhb Exp $
  */
 
 #include "opt_compat.h"

==== //depot/projects/trustedbsd/base/sys/kern/kern_ktrace.c#9 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_ktrace.c	8.2 (Berkeley) 9/23/93
- * $FreeBSD: src/sys/kern/kern_ktrace.c,v 1.69 2002/08/01 01:07:03 rwatson Exp $
+ * $FreeBSD: src/sys/kern/kern_ktrace.c,v 1.70 2002/08/01 13:35:38 jhb Exp $
  */
 
 #include "opt_ktrace.h"
@@ -271,9 +271,11 @@
 {
 
 	crfree(req->ktr_cred);
-	mtx_lock(&Giant);
-	vrele(req->ktr_vp);
-	mtx_unlock(&Giant);
+	if (req->ktr_vp != NULL) {
+		mtx_lock(&Giant);
+		vrele(req->ktr_vp);
+		mtx_unlock(&Giant);
+	}
 	mtx_lock(&ktrace_mtx);
 	STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list);
 	mtx_unlock(&ktrace_mtx);

==== //depot/projects/trustedbsd/base/sys/kern/kern_shutdown.c#10 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_shutdown.c	8.3 (Berkeley) 1/21/94
- * $FreeBSD: src/sys/kern/kern_shutdown.c,v 1.131 2002/07/17 02:23:44 gallatin Exp $
+ * $FreeBSD: src/sys/kern/kern_shutdown.c,v 1.133 2002/08/01 13:39:33 jhb Exp $
  */
 
 #include "opt_ddb.h"

==== //depot/projects/trustedbsd/base/sys/kern/subr_mbuf.c#12 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/kern/subr_mbuf.c,v 1.25 2002/07/31 01:42:19 rwatson Exp $
+ * $FreeBSD: src/sys/kern/subr_mbuf.c,v 1.26 2002/08/01 14:24:41 bmilekic Exp $
  */
 
 #include "opt_mac.h"
@@ -805,11 +805,6 @@
 	struct mb_bucket *bucket;
 	u_int owner;
 
-#ifdef MAC
-	if (type != MT_NOTMBUF && ((struct mbuf *)m)->m_flags & M_PKTHDR)
-		mac_destroy_mbuf((struct mbuf *)m);
-#endif
-
 	bucket = mb_list->ml_btable[MB_BUCKET_INDX(m, mb_list)];
 
 	/*
@@ -1266,8 +1261,8 @@
 		_mbhdr_setup(mb, type);
 #ifdef MAC
 		if (mac_init_mbuf(mb, how) != 0) {
-			mb_free(&mb_list_mbuf, mb, type, 0, NULL);
-			return (NULL);
+			m_free(mb);
+			return NULL;
 		}
 #endif
 	}
@@ -1315,8 +1310,8 @@
 		_mbhdr_setup(mb, type);
 #ifdef MAC
 		if (mac_init_mbuf(mb, how) != 0) {
-			mb_free(&mb_list_mbuf, mb, type, 0, NULL);
-			return (NULL);
+			m_free(mb);
+			return NULL;
 		}
 #endif
 		bzero(mtod(mb, caddr_t), MHLEN);
@@ -1345,7 +1340,11 @@
 		m_freem(mb->m_pkthdr.aux);
 		mb->m_pkthdr.aux = NULL;
 	}
-
+#ifdef MAC
+	if ((mb->m_flags & M_PKTHDR) &&
+	    (mb->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED))
+		mac_destroy_mbuf(mb);
+#endif
 	nb = mb->m_next;
 	if ((mb->m_flags & M_EXT) != 0) {
 		MEXT_REM_REF(mb);
@@ -1392,6 +1391,11 @@
 			m_freem(mb->m_pkthdr.aux);
 			mb->m_pkthdr.aux = NULL;
 		}
+#ifdef MAC
+		if ((mb->m_flags & M_PKTHDR) &&
+		    (mb->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED))
+			mac_destroy_mbuf(mb);
+#endif
 		persist = 0;
 		m = mb;
 		mb = mb->m_next;
@@ -1458,6 +1462,12 @@
 		_mcl_setup(mb);
 		_mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]);
 	}
+#ifdef MAC
+	if ((type & M_PKTHDR) && (mac_init_mbuf(mb, how) != 0)) {
+		m_free(mb);
+		return NULL;
+	}
+#endif
 	return (mb);
 }
 

==== //depot/projects/trustedbsd/base/sys/kern/subr_taskqueue.c#4 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.12 2002/04/04 21:03:26 jhb Exp $
+ *	$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.14 2002/08/01 13:37:22 jhb Exp $
  */
 
 #include <sys/param.h>
@@ -94,6 +94,7 @@
 {
 
 	mtx_lock(&queue->tq_mutex);
+	KASSERT(queue->tq_draining == 0, ("free'ing a draining taskqueue"));
 	queue->tq_draining = 1;
 	mtx_unlock(&queue->tq_mutex);
 

==== //depot/projects/trustedbsd/base/sys/kern/uipc_socket.c#16 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)uipc_socket.c	8.3 (Berkeley) 4/15/94
- * $FreeBSD: src/sys/kern/uipc_socket.c,v 1.127 2002/07/31 03:03:22 rwatson Exp $
+ * $FreeBSD: src/sys/kern/uipc_socket.c,v 1.128 2002/08/01 03:45:40 rwatson Exp $
  */
 
 #include "opt_inet.h"
@@ -1255,6 +1255,9 @@
 	struct	linger l;
 	struct	timeval tv;
 	u_long  val;
+#ifdef MAC
+	struct mac extmac;
+#endif /* MAC */
 
 	error = 0;
 	if (sopt->sopt_level != SOL_SOCKET) {
@@ -1379,6 +1382,20 @@
 				break;
 			}
 			break;
+		case SO_LABEL:
+#ifdef MAC
+			error = sooptcopyin(sopt, &extmac, sizeof extmac,
+			    sizeof extmac);
+			if (error)
+				goto bad;
+
+			error = mac_setsockopt_label_set(
+			    sopt->sopt_td->td_ucred, so, &extmac);
+
+#else /* MAC */
+			error = EOPNOTSUPP;
+#endif /* MAC */
+			break;
 		default:
 			error = ENOPROTOOPT;
 			break;
@@ -1435,6 +1452,9 @@
 #ifdef INET
 	struct accept_filter_arg *afap;
 #endif
+#ifdef MAC
+	struct mac extmac;
+#endif /* MAC */
 
 	error = 0;
 	if (sopt->sopt_level != SOL_SOCKET) {
@@ -1516,7 +1536,28 @@
 			tv.tv_usec = (optval % hz) * tick;
 			error = sooptcopyout(sopt, &tv, sizeof tv);
 			break;
-
+		case SO_LABEL:
+#ifdef MAC
+			error = mac_getsockopt_label_get(
+			    sopt->sopt_td->td_ucred, so, &extmac);
+			if (error)
+				return (error);
+			error = sooptcopyout(sopt, &extmac, sizeof extmac);
+#else /* MAC */
+			error = EOPNOTSUPP;
+#endif /* MAC */
+			break;
+		case SO_PEERLABEL:
+#ifdef MAC
+			error = mac_getsockopt_peerlabel_get(
+			    sopt->sopt_td->td_ucred, so, &extmac);
+			if (error)
+				return (error);
+			error = sooptcopyout(sopt, &extmac, sizeof extmac);
+#else /* MAC */
+			error = EOPNOTSUPP;
+#endif /* MAC */
+			break;
 		default:
 			error = ENOPROTOOPT;
 			break;

==== //depot/projects/trustedbsd/base/sys/kern/vfs_syscalls.c#22 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)vfs_syscalls.c	8.13 (Berkeley) 4/15/94
- * $FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.275 2002/08/01 01:29:03 rwatson Exp $
+ * $FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.276 2002/08/01 03:50:08 rwatson Exp $
  */
 
 /* For 4.3 integer FS ID compatibility */
@@ -397,6 +397,10 @@
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
 	if (vp->v_type != VDIR)
 		error = ENOTDIR;
+#ifdef MAC
+	else if ((error = mac_check_vnode_chdir(td->td_ucred, vp)) != 0) {
+	}
+#endif
 	else
 		error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td);
 	while (!error && (mp = vp->v_mountedhere) != NULL) {
@@ -524,6 +528,10 @@
 	mtx_lock(&Giant);
 	if ((error = change_dir(&nd, td)) != 0)
 		goto error;
+#ifdef MAC
+	if ((error = mac_check_vnode_chroot(td->td_ucred, nd.ni_vp)))
+		goto error;
+#endif
 	FILEDESC_LOCK(fdp);
 	if (chroot_allow_open_directories == 0 ||
 	    (chroot_allow_open_directories == 1 && fdp->fd_rdir != rootvnode)) {
@@ -567,6 +575,10 @@
 	vp = ndp->ni_vp;
 	if (vp->v_type != VDIR)
 		error = ENOTDIR;
+#ifdef MAC
+	else if ((error = mac_check_vnode_chdir(td->td_ucred, vp)) != 0) {
+	}
+#endif
 	else
 		error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td);
 	if (error)

==== //depot/projects/trustedbsd/base/sys/netinet/ip_icmp.c#8 (text+ko) ====

@@ -31,13 +31,15 @@
  * SUCH DAMAGE.
  *
  *	@(#)ip_icmp.c	8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.69 2002/03/22 16:45:54 ru Exp $
+ * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.70 2002/08/01 03:53:04 rwatson Exp $
  */
 
 #include "opt_ipsec.h"
+#include "opt_mac.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/mac.h>
 #include <sys/mbuf.h>
 #include <sys/protosw.h>
 #include <sys/socket.h>
@@ -159,6 +161,9 @@
 	m = m_gethdr(M_DONTWAIT, MT_HEADER);
 	if (m == NULL)
 		goto freeit;
+#ifdef MAC
+	mac_create_mbuf_netlayer(n, m);
+#endif
 	icmplen = min(oiplen + 8, oip->ip_len);
 	if (icmplen < sizeof(struct ip))
 		panic("icmp_error: bad length");

==== //depot/projects/trustedbsd/base/sys/netinet/tcp_subr.c#13 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)tcp_subr.c	8.2 (Berkeley) 5/24/95
- * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.139 2002/07/31 19:06:49 rwatson Exp $
+ * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.140 2002/08/01 03:54:43 rwatson Exp $
  */
 
 #include "opt_compat.h"
@@ -347,6 +347,8 @@
 #endif /* INET6 */
 	int ipflags = 0;
 
+	KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL"));
+
 #ifdef INET6
 	isipv6 = IP_VHL_V(((struct ip *)ipgen)->ip_vhl) == 6;
 	ip6 = ipgen;

==== //depot/projects/trustedbsd/base/usr.bin/sockstat/sockstat.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/sockstat/sockstat.c,v 1.1 2002/07/31 12:32:03 des Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/sockstat/sockstat.c,v 1.2 2002/08/01 11:02:30 des Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -258,6 +258,20 @@
 		}
 		if ((inp->inp_vflag & vflag) == 0)
 			continue;
+		if (inp->inp_vflag & INP_IPV4) {
+			if ((inp->inp_fport == 0 && !opt_l) ||
+			    (inp->inp_fport != 0 && !opt_c))
+				continue;
+		} else if (inp->inp_vflag & INP_IPV6) {
+			if ((inp->in6p_fport == 0 && !opt_l) ||
+			    (inp->in6p_fport != 0 && !opt_c))
+				continue;
+		} else {
+			if (opt_v)
+				warnx("invalid vflag 0x%x", inp->inp_vflag);
+			free(sock);
+			continue;
+		}
 		if ((sock = calloc(1, sizeof *sock)) == NULL)
 			err(1, "malloc()");
 		sock->socket = so->xso_so;
@@ -274,11 +288,6 @@
 			    &inp->in6p_laddr, inp->in6p_lport);
 			sockaddr(&sock->faddr, sock->family,
 			    &inp->in6p_faddr, inp->in6p_fport);
-		} else {
-			if (opt_v)
-				warnx("invalid vflag 0x%x", inp->inp_vflag);
-			free(sock);
-			continue;
 		}
 		sock->vflag = inp->inp_vflag;
 		sock->protoname = protoname;
@@ -348,6 +357,9 @@
 			warnx("struct xunpcb size mismatch");
 			goto out;
 		}
+		if ((xup->xu_unp.unp_conn == NULL && !opt_l) ||
+		    (xup->xu_unp.unp_conn != NULL && !opt_c))
+			continue;
 		if ((sock = calloc(1, sizeof *sock)) == NULL)
 			err(1, "malloc()");
 		sock->socket = xup->xu_socket.xso_so;
@@ -454,7 +466,6 @@
 	setpassent(1);
 	for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) {
 		hash = (int)((uintptr_t)xf->xf_data % HASHSIZE);
-		/*xprintf("%p %d\n", xf->xf_data, hash);*/
 		for (s = sockhash[hash]; s != NULL; s = s->next)
 			if (s->socket == xf->xf_data)
 				break;

==== //depot/projects/trustedbsd/base/usr.sbin/sysinstall/doc.c#3 (text+ko) ====

@@ -4,7 +4,7 @@
  * This is probably the last attempt in the `sysinstall' line, the next
  * generation being slated for what's essentially a complete rewrite.
  *
- * $FreeBSD: src/usr.sbin/sysinstall/doc.c,v 1.30 2002/04/23 22:16:41 obrien Exp $
+ * $FreeBSD: src/usr.sbin/sysinstall/doc.c,v 1.31 2002/08/01 10:20:59 blackend Exp $
  *
  * Copyright (c) 1995
  *	Jordan Hubbard.  All rights reserved.
@@ -105,12 +105,12 @@
     else if (strstr(str, "FAQ")) {
 	where = strcpy(target, "/usr/share/doc/faq/index.html");
 	if (!file_readable(target))
-	    where = strcpy(target, "http://www.freebsd.org/FAQ");
+	    where = strcpy(target, "http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq");
     }
     else if (strstr(str, "Handbook")) {
 	where = strcpy(target, "/usr/share/doc/handbook/index.html");
 	if (!file_readable(target))
-	    where = strcpy(target, "http://www.freebsd.org/handbook");
+	    where = strcpy(target, "http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook");
     }
     if (where) {
 	sprintf(tmp, "%s %s", browser, target);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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