From owner-p4-projects@FreeBSD.ORG Sun Dec 14 19:42:38 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ED34A1065675; Sun, 14 Dec 2008 19:42:37 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0F921065670 for ; Sun, 14 Dec 2008 19:42:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 9D57F8FC0C for ; Sun, 14 Dec 2008 19:42:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEJgb4B097927 for ; Sun, 14 Dec 2008 19:42:37 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBEJgbUp097925 for perforce@freebsd.org; Sun, 14 Dec 2008 19:42:37 GMT (envelope-from ed@FreeBSD.org) Date: Sun, 14 Dec 2008 19:42:37 GMT Message-Id: <200812141942.mBEJgbUp097925@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 154656 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 19:42:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=154656 Change 154656 by ed@ed_dull on 2008/12/14 19:41:48 IFC, so I can generate new diffs. Affected files ... .. //depot/projects/mpsafetty/sbin/atacontrol/atacontrol.8#2 integrate .. //depot/projects/mpsafetty/sbin/devd/devd.cc#2 integrate .. //depot/projects/mpsafetty/sbin/devd/devd.conf.5#2 integrate .. //depot/projects/mpsafetty/sys/amd64/amd64/exception.S#4 integrate .. //depot/projects/mpsafetty/sys/boot/Makefile#6 integrate .. //depot/projects/mpsafetty/sys/contrib/pf/net/pf_subr.c#6 integrate .. //depot/projects/mpsafetty/sys/dev/snp/snp.c#16 integrate .. //depot/projects/mpsafetty/sys/kern/tty.c#67 integrate .. //depot/projects/mpsafetty/sys/net/rtsock.c#9 integrate .. //depot/projects/mpsafetty/sys/netgraph/netgraph.h#7 integrate .. //depot/projects/mpsafetty/sys/netgraph/ng_base.c#11 integrate .. //depot/projects/mpsafetty/sys/netgraph/ng_tty.c#12 integrate .. //depot/projects/mpsafetty/sys/netinet/in_pcb.c#15 integrate .. //depot/projects/mpsafetty/sys/netinet/in_rmx.c#7 integrate .. //depot/projects/mpsafetty/sys/netinet/ip_fw2.c#16 integrate .. //depot/projects/mpsafetty/sys/netinet/tcp_subr.c#13 integrate .. //depot/projects/mpsafetty/sys/netinet/vinet.h#5 integrate .. //depot/projects/mpsafetty/sys/netinet6/in6_rmx.c#8 integrate .. //depot/projects/mpsafetty/sys/powerpc/ofw/ofw_syscons.c#5 integrate .. //depot/projects/mpsafetty/sys/powerpc/ofw/ofw_syscons.h#2 integrate .. //depot/projects/mpsafetty/sys/sys/ttyhook.h#10 integrate .. //depot/projects/mpsafetty/usr.sbin/jls/jls.c#4 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/cdrom.c#2 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/label.c#2 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/main.c#2 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/sysinstall.8#2 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/sysinstall.h#5 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/system.c#2 integrate Differences ... ==== //depot/projects/mpsafetty/sbin/atacontrol/atacontrol.8#2 (text+ko) ==== @@ -23,9 +23,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sbin/atacontrol/atacontrol.8,v 1.31 2008/06/25 18:11:22 bz Exp $ +.\" $FreeBSD: src/sbin/atacontrol/atacontrol.8,v 1.32 2008/12/14 12:56:56 ru Exp $ .\" -.Dd June 25, 2008 +.Dd December 14, 2008 .Dt ATACONTROL 8 .Os .Sh NAME @@ -63,6 +63,7 @@ .Nm .Ic mode .Ar device +.Op Ar mode .Nm .Ic info .Ar channel @@ -94,7 +95,7 @@ .Ar channel argument is the ATA channel device (e.g., ata0) on which to operate. The following commands are supported: -.Bl -tag -width "rebuild" +.Bl -tag -width ".Ic addspare" .It Ic attach Attach an ATA .Ar channel . @@ -162,9 +163,13 @@ .It Ic status Get the status of an ATA RAID. .It Ic mode -Without the mode argument, the current transfer modes of the +Without the +.Ar mode +argument, the current transfer mode of the device are printed. -If the mode argument is given, the ATA driver +If the +.Ar mode +argument is given, the ATA driver is asked to change the transfer mode to the one given. The ATA driver will reject modes that are not supported by the hardware. @@ -190,13 +195,12 @@ .Cm UDMA6 (alias .Cm UDMA133 ) . -The device name and manufacture/version strings are shown. .It Ic cap Show detailed info about the device on .Ar device . .It Ic spindown Set or report timeout after which the -.Ar device +.Ar device will be spun down. To arm the timeout the device needs at least one more request after setting the timeout. @@ -205,6 +209,7 @@ .It Ic info Show info about the attached devices on the .Ar channel . +The device name and manufacture/version strings are shown. .It Ic list Show info about all attached devices on all active controllers. .El @@ -312,7 +317,7 @@ RAID controller, then shut the system down, make sure that the disk that was still working is moved to the bootable position (channel 0 or whatever the BIOS allows the system to boot from) and the blank disk -is placed in the secondary position, then boot the system into +is placed in the secondary position, then boot the system into single-user mode and issue the command: .Pp .Dl "atacontrol addspare ar0 ad6" ==== //depot/projects/mpsafetty/sbin/devd/devd.cc#2 (text+ko) ==== @@ -34,7 +34,7 @@ // - devd.conf needs more details on the supported statements. #include -__FBSDID("$FreeBSD: src/sbin/devd/devd.cc,v 1.33 2006/09/17 22:49:26 ru Exp $"); +__FBSDID("$FreeBSD: src/sbin/devd/devd.cc,v 1.34 2008/12/14 11:48:51 phk Exp $"); #include #include @@ -307,7 +307,7 @@ config::parse_one_file(const char *fn) { if (Dflag) - printf("Parsing %s\n", fn); + fprintf(stderr, "Parsing %s\n", fn); yyin = fopen(fn, "r"); if (yyin == NULL) err(1, "Cannot open config file %s", fn); @@ -325,7 +325,7 @@ char path[PATH_MAX]; if (Dflag) - printf("Parsing files in %s\n", dirname); + fprintf(stderr, "Parsing files in %s\n", dirname); dirp = opendir(dirname); if (dirp == NULL) return; ==== //depot/projects/mpsafetty/sbin/devd/devd.conf.5#2 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sbin/devd/devd.conf.5,v 1.11 2006/10/24 20:20:41 ru Exp $ +.\" $FreeBSD: src/sbin/devd/devd.conf.5,v 1.12 2008/12/14 11:47:39 phk Exp $ .\" .\" The section on comments was taken from named.conf.5, which has the .\" following copyright: @@ -110,7 +110,7 @@ .It Ic directory Qq Ar /some/path ; Adds the given directory to the list of directories from which .Xr devd 8 -will read +will read all files named "*.conf" as further configuration files. Any number of .Ic directory ==== //depot/projects/mpsafetty/sys/amd64/amd64/exception.S#4 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.134 2008/12/13 13:07:12 jkoshy Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.135 2008/12/14 09:06:28 jkoshy Exp $ */ #include "opt_atpic.h" @@ -459,9 +459,9 @@ */ movq %rsp,%rsi /* source stack pointer */ movq $TF_SIZE,%rcx - movq PCPU(RSP0),%rbx - subq %rcx,%rbx - movq %rbx,%rdi /* destination stack pointer */ + movq PCPU(RSP0),%rdx + subq %rcx,%rdx + movq %rdx,%rdi /* destination stack pointer */ shrq $3,%rcx /* trap frame size in long words */ cld @@ -470,7 +470,7 @@ movl %ss,%eax pushq %rax /* tf_ss */ - pushq %rbx /* tf_rsp (on kernel stack) */ + pushq %rdx /* tf_rsp (on kernel stack) */ pushfq /* tf_rflags */ movl %cs,%eax pushq %rax /* tf_cs */ ==== //depot/projects/mpsafetty/sys/boot/Makefile#6 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/Makefile,v 1.37 2008/11/17 20:49:29 pjd Exp $ +# $FreeBSD: src/sys/boot/Makefile,v 1.38 2008/12/14 02:57:41 nyan Exp $ .include @@ -12,7 +12,7 @@ .endif # Build EFI library. -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64" SUBDIR+= efi .endif ==== //depot/projects/mpsafetty/sys/contrib/pf/net/pf_subr.c#6 (text+ko) ==== @@ -32,7 +32,7 @@ #include "opt_inet6.h" #include -__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_subr.c,v 1.8 2008/12/10 23:12:39 zec Exp $"); +__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_subr.c,v 1.9 2008/12/13 22:04:52 bz Exp $"); #include #include @@ -116,22 +116,22 @@ #define ISN_STATIC_INCREMENT 4096 #define ISN_RANDOM_INCREMENT (4096 - 1) -static u_char isn_secret[32]; -static int isn_last_reseed; -static u_int32_t isn_offset; -static MD5_CTX isn_ctx; +static u_char pf_isn_secret[32]; +static int pf_isn_last_reseed; +static u_int32_t pf_isn_offset; u_int32_t pf_new_isn(struct pf_state *s) { + MD5_CTX isn_ctx; u_int32_t md5_buffer[4]; u_int32_t new_isn; struct pf_state_host *src, *dst; /* Seed if this is the first use, reseed if requested. */ - if (isn_last_reseed == 0) { - read_random(&isn_secret, sizeof(isn_secret)); - isn_last_reseed = ticks; + if (pf_isn_last_reseed == 0) { + read_random(&pf_isn_secret, sizeof(pf_isn_secret)); + pf_isn_last_reseed = ticks; } if (s->direction == PF_IN) { @@ -160,11 +160,11 @@ MD5Update(&isn_ctx, (u_char *) &src->addr, sizeof(struct in_addr)); } - MD5Update(&isn_ctx, (u_char *) &isn_secret, sizeof(isn_secret)); + MD5Update(&isn_ctx, (u_char *) &pf_isn_secret, sizeof(pf_isn_secret)); MD5Final((u_char *) &md5_buffer, &isn_ctx); new_isn = (tcp_seq) md5_buffer[0]; - isn_offset += ISN_STATIC_INCREMENT + + pf_isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); - new_isn += isn_offset; + new_isn += pf_isn_offset; return (new_isn); } ==== //depot/projects/mpsafetty/sys/dev/snp/snp.c#16 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/snp/snp.c,v 1.111 2008/11/05 15:04:03 ed Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/snp/snp.c,v 1.112 2008/12/13 21:17:46 mav Exp $"); #include #include @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -246,7 +247,7 @@ sx_xunlock(&snp_register_lock); return (EBUSY); } - error = ttyhook_register(&ss->snp_tty, td, *(int *)data, + error = ttyhook_register(&ss->snp_tty, td->td_proc, *(int *)data, &snp_hook, ss); sx_xunlock(&snp_register_lock); if (error != 0) ==== //depot/projects/mpsafetty/sys/kern/tty.c#67 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.298 2008/11/08 20:40:39 ed Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.299 2008/12/13 21:17:46 mav Exp $"); #include "opt_compat.h" @@ -37,6 +37,7 @@ #include #include #include +#include #include #ifdef COMPAT_43TTY #include @@ -1673,18 +1674,24 @@ } int -ttyhook_register(struct tty **rtp, struct thread *td, int fd, +ttyhook_register(struct tty **rtp, struct proc *p, int fd, struct ttyhook *th, void *softc) { struct tty *tp; struct file *fp; struct cdev *dev; struct cdevsw *cdp; + struct filedesc *fdp; int error; /* Validate the file descriptor. */ - if (fget(td, fd, &fp) != 0) - return (EINVAL); + if ((fdp = p->p_fd) == NULL) + return (EBADF); + FILEDESC_SLOCK(fdp); + if ((fp = fget_locked(fdp, fd)) == NULL || fp->f_ops == &badfileops) { + FILEDESC_SUNLOCK(fdp); + return (EBADF); + } /* Make sure the vnode is bound to a character device. */ error = EINVAL; @@ -1723,7 +1730,7 @@ done3: tty_unlock(tp); done2: dev_relthread(dev); -done1: fdrop(fp, td); +done1: FILEDESC_SUNLOCK(fdp); return (error); } ==== //depot/projects/mpsafetty/sys/net/rtsock.c#9 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 - * $FreeBSD: src/sys/net/rtsock.c,v 1.156 2008/12/10 09:21:52 kmacy Exp $ + * $FreeBSD: src/sys/net/rtsock.c,v 1.157 2008/12/13 22:41:36 thompsa Exp $ */ #include "opt_sctp.h" #include "opt_mpath.h" @@ -673,10 +673,10 @@ rt->rt_ifa->ifa_addr))) { RT_UNLOCK(rt); RADIX_NODE_HEAD_LOCK(rnh); - if ((error = rt_getifa_fib(&info, - rt->rt_fibnum)) != 0) + error = rt_getifa_fib(&info, rt->rt_fibnum); + RADIX_NODE_HEAD_UNLOCK(rnh); + if (error != 0) senderr(error); - RADIX_NODE_HEAD_UNLOCK(rnh); RT_LOCK(rt); } if (info.rti_ifa != NULL && ==== //depot/projects/mpsafetty/sys/netgraph/netgraph.h#7 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Julian Elischer * - * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.79 2008/12/10 23:12:39 zec Exp $ + * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.80 2008/12/13 22:26:24 mav Exp $ * $Whistle: netgraph.h,v 1.29 1999/11/01 07:56:13 julian Exp $ */ @@ -1130,7 +1130,6 @@ item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); void ng_replace_retaddr(node_p here, item_p item, ng_ID_t retaddr); int ng_rmhook_self(hook_p hook); /* if a node wants to kill a hook */ -int ng_rmnode_flags(node_p here, int flags); int ng_rmnode_self(node_p here); /* if a node wants to suicide */ int ng_rmtype(struct ng_type *tp); int ng_snd_item(item_p item, int queue); ==== //depot/projects/mpsafetty/sys/netgraph/ng_base.c#11 (text+ko) ==== @@ -38,7 +38,7 @@ * Authors: Julian Elischer * Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.169 2008/12/10 23:12:39 zec Exp $ + * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.170 2008/12/13 22:26:24 mav Exp $ * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ */ @@ -1521,7 +1521,7 @@ /* Shut this node down as soon as everyone is clear of it */ /* Should add arg "immediately" to jump the queue */ int -ng_rmnode_flags(node_p node, int flags) +ng_rmnode_self(node_p node) { int error; @@ -1531,16 +1531,10 @@ if (node->nd_flags & NGF_CLOSING) return (0); - error = ng_send_fn1(node, NULL, &ng_rmnode, NULL, 0, flags); + error = ng_send_fn(node, NULL, &ng_rmnode, NULL, 0); return (error); } -int -ng_rmnode_self(node_p node) -{ - return (ng_rmnode_flags(node, NG_NOFLAGS)); -} - static void ng_rmhook_part2(node_p node, hook_p hook, void *arg1, int arg2) { ==== //depot/projects/mpsafetty/sys/netgraph/ng_tty.c#12 (text+ko) ==== @@ -39,7 +39,7 @@ * * Updated by Andrew Thompson for MPSAFE TTY. * - * $FreeBSD: src/sys/netgraph/ng_tty.c,v 1.41 2008/11/08 06:25:57 mav Exp $ + * $FreeBSD: src/sys/netgraph/ng_tty.c,v 1.43 2008/12/13 22:05:46 mav Exp $ * $Whistle: ng_tty.c,v 1.21 1999/11/01 09:24:52 julian Exp $ */ @@ -114,7 +114,6 @@ static th_rint_t ngt_rint; static th_rint_bypass_t ngt_rint_bypass; static th_rint_poll_t ngt_rint_poll; -static th_close_t ngt_close; static struct ttyhook ngt_hook = { .th_getc_inject = ngt_getc_inject, @@ -122,7 +121,6 @@ .th_rint = ngt_rint, .th_rint_bypass = ngt_rint_bypass, .th_rint_poll = ngt_rint_poll, - .th_close = ngt_close, }; /* Netgraph node type descriptor */ @@ -252,7 +250,6 @@ ngt_rcvmsg(node_p node, item_p item, hook_p lasthook) { struct proc *p; - struct thread *td; const sc_p sc = NG_NODE_PRIVATE(node); struct ng_mesg *msg, *resp = NULL; int error = 0; @@ -266,12 +263,13 @@ return (EBUSY); p = pfind(((int *)msg->data)[0]); - if (p == NULL) + if (p == NULL || (p->p_flag & P_WEXIT)) return (ESRCH); - td = FIRST_THREAD_IN_PROC(p); - error = ttyhook_register(&sc->tp, td, ((int *)msg->data)[1], + _PHOLD(p); + PROC_UNLOCK(p); + error = ttyhook_register(&sc->tp, p, ((int *)msg->data)[1], &ngt_hook, sc); - PROC_UNLOCK(p); + PRELE(p); if (error != 0) return (error); break; @@ -515,12 +513,3 @@ return (1); } -static void -ngt_close(struct tty *tp) -{ - sc_p sc = ttyhook_softc(tp); - - /* Must be queued to drop the tty lock */ - ng_rmnode_flags(sc->node, NG_QUEUE); -} - ==== //depot/projects/mpsafetty/sys/netinet/in_pcb.c#15 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/in_pcb.c,v 1.233 2008/12/10 13:24:38 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/in_pcb.c,v 1.234 2008/12/14 17:47:33 bz Exp $"); #include "opt_ddb.h" #include "opt_ipsec.h" @@ -695,6 +695,10 @@ ia = ifatoia(ifa_ifwithnet(sintosa(&sain))); if (cred == NULL || !jailed(cred)) { +#if __FreeBSD_version < 800000 + if (ia == NULL) + ia = (struct in_ifaddr *)sro.ro_rt->rt_ifa; +#endif if (ia == NULL) { error = ENETUNREACH; goto done; ==== //depot/projects/mpsafetty/sys/netinet/in_rmx.c#7 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/in_rmx.c,v 1.65 2008/12/02 21:37:28 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/in_rmx.c,v 1.66 2008/12/13 20:16:03 kmacy Exp $"); #include #include @@ -115,7 +115,7 @@ * ARP entry and delete it if so. */ rt2 = in_rtalloc1((struct sockaddr *)sin, 0, - RTF_CLONING, rt->rt_fibnum); + RTF_CLONING|RTF_RNH_LOCKED, rt->rt_fibnum); if (rt2) { if (rt2->rt_flags & RTF_LLINFO && rt2->rt_flags & RTF_HOST && ==== //depot/projects/mpsafetty/sys/netinet/ip_fw2.c#16 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/ip_fw2.c,v 1.204 2008/12/13 19:13:03 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/ip_fw2.c,v 1.206 2008/12/13 20:34:41 kmacy Exp $"); #define DEB(x) #define DDB(x) x @@ -1814,6 +1814,7 @@ INIT_VNET_IPFW(curvnet); struct radix_node_head *rnh; struct table_entry *ent; + struct radix_node *rn; if (tbl >= IPFW_TABLES_MAX) return (EINVAL); @@ -1826,8 +1827,10 @@ ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; IPFW_WLOCK(ch); - if (rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent) == - NULL) { + RADIX_NODE_HEAD_LOCK(rnh); + rn = rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent); + RADIX_NODE_HEAD_UNLOCK(rnh); + if (rn == NULL) { IPFW_WUNLOCK(ch); free(ent, M_IPFW_TBL); return (EEXIST); ==== //depot/projects/mpsafetty/sys/netinet/tcp_subr.c#13 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/tcp_subr.c,v 1.327 2008/12/11 16:05:07 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/tcp_subr.c,v 1.328 2008/12/13 21:59:18 bz Exp $"); #include "opt_compat.h" #include "opt_inet.h" @@ -1486,13 +1486,13 @@ static u_char isn_secret[32]; static int isn_last_reseed; static u_int32_t isn_offset, isn_offset_old; -static MD5_CTX isn_ctx; #endif tcp_seq tcp_new_isn(struct tcpcb *tp) { INIT_VNET_INET(tp->t_vnet); + MD5_CTX isn_ctx; u_int32_t md5_buffer[4]; tcp_seq new_isn; @@ -1508,25 +1508,25 @@ } /* Compute the md5 hash and return the ISN. */ - MD5Init(&V_isn_ctx); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_fport, sizeof(u_short)); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_lport, sizeof(u_short)); + MD5Init(&isn_ctx); + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_fport, sizeof(u_short)); + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_lport, sizeof(u_short)); #ifdef INET6 if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) { - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->in6p_faddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_faddr, sizeof(struct in6_addr)); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->in6p_laddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_laddr, sizeof(struct in6_addr)); } else #endif { - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_faddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_faddr, sizeof(struct in_addr)); - MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_laddr, + MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_laddr, sizeof(struct in_addr)); } - MD5Update(&V_isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret)); - MD5Final((u_char *) &md5_buffer, &V_isn_ctx); + MD5Update(&isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret)); + MD5Final((u_char *) &md5_buffer, &isn_ctx); new_isn = (tcp_seq) md5_buffer[0]; V_isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); ==== //depot/projects/mpsafetty/sys/netinet/vinet.h#5 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netinet/vinet.h,v 1.6 2008/12/10 23:12:39 zec Exp $ + * $FreeBSD: src/sys/netinet/vinet.h,v 1.7 2008/12/13 21:59:18 bz Exp $ */ #ifndef _NETINET_VINET_H_ @@ -142,7 +142,6 @@ int _isn_last_reseed; u_int32_t _isn_offset; u_int32_t _isn_offset_old; - MD5_CTX _isn_ctx; struct inpcbhead _udb; struct inpcbinfo _udbinfo; @@ -265,7 +264,6 @@ #define V_ipsendredirects VNET_INET(ipsendredirects) #define V_ipstat VNET_INET(ipstat) #define V_ipstealth VNET_INET(ipstealth) -#define V_isn_ctx VNET_INET(isn_ctx) #define V_isn_last_reseed VNET_INET(isn_last_reseed) #define V_isn_offset VNET_INET(isn_offset) #define V_isn_offset_old VNET_INET(isn_offset_old) ==== //depot/projects/mpsafetty/sys/netinet6/in6_rmx.c#8 (text+ko) ==== @@ -73,7 +73,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet6/in6_rmx.c,v 1.31 2008/12/08 00:28:21 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet6/in6_rmx.c,v 1.32 2008/12/13 20:15:42 kmacy Exp $"); #include #include @@ -160,7 +160,7 @@ * Find out if it is because of an * ARP entry and delete it if so. */ - rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_CLONING); + rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_RNH_LOCKED|RTF_CLONING); if (rt2) { if (rt2->rt_flags & RTF_LLINFO && rt2->rt_flags & RTF_HOST && @@ -187,7 +187,7 @@ * net route entry, 3ffe:0501:: -> if0. * This case should not raise an error. */ - rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_CLONING); + rt2 = rtalloc1((struct sockaddr *)sin6, 0, RTF_RNH_LOCKED|RTF_CLONING); if (rt2) { if ((rt2->rt_flags & (RTF_CLONING|RTF_HOST|RTF_GATEWAY)) == RTF_CLONING ==== //depot/projects/mpsafetty/sys/powerpc/ofw/ofw_syscons.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/powerpc/ofw/ofw_syscons.c,v 1.13 2008/10/15 03:38:03 nwhitehorn Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/ofw/ofw_syscons.c,v 1.15 2008/12/13 20:53:57 nwhitehorn Exp $"); #include #include @@ -137,10 +137,12 @@ */ static vi_blank_display_t ofwfb_blank_display8; static vi_putc_t ofwfb_putc8; +static vi_putm_t ofwfb_putm8; static vi_set_border_t ofwfb_set_border8; static vi_blank_display_t ofwfb_blank_display32; static vi_putc_t ofwfb_putc32; +static vi_putm_t ofwfb_putm32; static vi_set_border_t ofwfb_set_border32; VIDEO_DRIVER(ofwfb, ofwfbvidsw, ofwfb_configure); @@ -250,10 +252,12 @@ if (depth == 8) { sc->sc_blank = ofwfb_blank_display8; sc->sc_putc = ofwfb_putc8; + sc->sc_putm = ofwfb_putm8; sc->sc_set_border = ofwfb_set_border8; } else if (depth == 32) { sc->sc_blank = ofwfb_blank_display32; sc->sc_putc = ofwfb_putc32; + sc->sc_putm = ofwfb_putm32; sc->sc_set_border = ofwfb_set_border32; } else return (0); @@ -304,36 +308,14 @@ { struct ofwfb_softc *sc; video_info_t *vi; - char name[64]; - ihandle_t ih; - int i; int cborder; int font_height; - int retval; sc = (struct ofwfb_softc *)adp; vi = &adp->va_info; vid_init_struct(adp, "ofwfb", -1, unit); - if (sc->sc_depth == 8) { - /* - * Install the ISO6429 colormap - older OFW systems - * don't do this by default - */ - memset(name, 0, sizeof(name)); - OF_package_to_path(sc->sc_node, name, sizeof(name)); - ih = OF_open(name); - for (i = 0; i < 16; i++) { - OF_call_method("color!", ih, 4, 1, - ofwfb_cmap[i].red, - ofwfb_cmap[i].green, - ofwfb_cmap[i].blue, - i, - &retval); - } - } - /* The default font size can be overridden by loader */ font_height = 16; TUNABLE_INT_FETCH("hw.syscons.fsize", &font_height); @@ -375,10 +357,13 @@ */ adp->va_window = (vm_offset_t) ofwfb_static_window; - /* Enable future font-loading and flag color support */ - adp->va_flags |= V_ADP_FONT | V_ADP_COLOR; - - ofwfb_blank_display(&sc->sc_va, V_DISPLAY_ON); + /* + * Enable future font-loading and flag color support, as well as + * adding V_ADP_MODECHANGE so that we ofwfb_set_mode() gets called + * when the X server shuts down. This enables us to get the console + * back when X disappears. + */ + adp->va_flags |= V_ADP_FONT | V_ADP_COLOR | V_ADP_MODECHANGE; ofwfb_set_mode(&sc->sc_va, 0); @@ -404,6 +389,37 @@ static int ofwfb_set_mode(video_adapter_t *adp, int mode) { + struct ofwfb_softc *sc; + char name[64]; + ihandle_t ih; + int i, retval; + + sc = (struct ofwfb_softc *)adp; + + /* + * Open the display device, which will initialize it. + */ + + memset(name, 0, sizeof(name)); + OF_package_to_path(sc->sc_node, name, sizeof(name)); + ih = OF_open(name); + + if (sc->sc_depth == 8) { + /* + * Install the ISO6429 colormap - older OFW systems + * don't do this by default + */ + for (i = 0; i < 16; i++) { + OF_call_method("color!", ih, 4, 1, + ofwfb_cmap[i].red, + ofwfb_cmap[i].green, + ofwfb_cmap[i].blue, + i, + &retval); + } + } + + ofwfb_blank_display(&sc->sc_va, V_DISPLAY_ON); return (0); } @@ -823,7 +839,86 @@ sc = (struct ofwfb_softc *)adp; - /* put mouse */ + return ((*sc->sc_putm)(adp, x, y, pixel_image, pixel_mask, size, + width)); +} + +static int +ofwfb_putm8(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, + uint32_t pixel_mask, int size, int width) +{ + struct ofwfb_softc *sc; + int i, j, k; + uint32_t *addr; + u_char fg, bg; + union { + uint32_t l[2]; + uint8_t c[8]; + } ch; + + + sc = (struct ofwfb_softc *)adp; + addr = (u_int32_t *)((int)sc->sc_addr + + (y + sc->sc_ymargin)*sc->sc_stride + + x + sc->sc_xmargin); + + fg = ofwfb_foreground(SC_NORM_ATTR); + bg = ofwfb_background(SC_NORM_ATTR); + + for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { + /* + * Use the current values for the line + */ + ch.l[0] = addr[0]; + ch.l[1] = addr[1]; + + /* + * Calculate 2 x 4-chars at a time, and then + * write these out. + */ + for (j = 0, k = width; j < 8; j++, k--) { + if (x + j >= sc->sc_width - 2*sc->sc_xmargin) + continue; + + if (pixel_image[i] & (1 << k)) + ch.c[j] = (ch.c[j] == fg) ? bg : fg; + } + + addr[0] = ch.l[0]; + addr[1] = ch.l[1]; + addr += (sc->sc_stride / sizeof(u_int32_t)); + } + + return (0); +} + +static int +ofwfb_putm32(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, + uint32_t pixel_mask, int size, int width) +{ + struct ofwfb_softc *sc; + int i, j, k; + uint32_t fg, bg; + uint32_t *addr; + + sc = (struct ofwfb_softc *)adp; + addr = (uint32_t *)sc->sc_addr + + (y + sc->sc_ymargin)*(sc->sc_stride/4) + + x + sc->sc_xmargin; + + fg = ofwfb_pix32(ofwfb_foreground(SC_NORM_ATTR)); + bg = ofwfb_pix32(ofwfb_background(SC_NORM_ATTR)); + + for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { + for (j = 0, k = width; j < 8; j++, k--) { + if (x + j >= sc->sc_width - 2*sc->sc_xmargin) + continue; + + if (pixel_image[i] & (1 << k)) + *(addr + j) = (*(addr + j) == fg) ? bg : fg; + } + addr += (sc->sc_stride/4); + } return (0); } ==== //depot/projects/mpsafetty/sys/powerpc/ofw/ofw_syscons.h#2 (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/powerpc/ofw/ofw_syscons.h,v 1.4 2005/02/25 02:29:01 grehan Exp $ + * $FreeBSD: src/sys/powerpc/ofw/ofw_syscons.h,v 1.5 2008/12/13 20:13:22 nwhitehorn Exp $ */ #ifndef _OFW_SYSCONS_H_ @@ -51,6 +51,7 @@ vi_blank_display_t *sc_blank; vi_putc_t *sc_putc; + vi_putm_t *sc_putm; vi_set_border_t *sc_set_border; #define OFWSC_MAXADDR 8 ==== //depot/projects/mpsafetty/sys/sys/ttyhook.h#10 (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/sys/ttyhook.h,v 1.1 2008/09/22 19:25:14 ed Exp $ + * $FreeBSD: src/sys/sys/ttyhook.h,v 1.2 2008/12/13 21:17:46 mav Exp $ */ #ifndef _SYS_TTYHOOK_H_ @@ -66,7 +66,7 @@ th_close_t *th_close; }; -int ttyhook_register(struct tty **, struct thread *, int, +int ttyhook_register(struct tty **, struct proc *, int, struct ttyhook *, void *); void ttyhook_unregister(struct tty *); #define ttyhook_softc(tp) ((tp)->t_hooksoftc) ==== //depot/projects/mpsafetty/usr.sbin/jls/jls.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/jls/jls.c,v 1.7 2008/12/11 01:04:25 bz Exp $ + * $FreeBSD: src/usr.sbin/jls/jls.c,v 1.8 2008/12/14 16:56:47 bz Exp $ */ #include @@ -48,7 +48,7 @@ #ifdef SUPPORT_OLD_XPRISON static -char *print_xprison_v1(void *p, char *end) +char *print_xprison_v1(void *p, char *end, unsigned flags) { struct xprison_v1 *xp; struct in_addr in; @@ -57,15 +57,18 @@ errx(1, "Invalid length for jail"); xp = (struct xprison_v1 *)p; - printf("%6d %-29.29s %.74s\n", - xp->pr_id, xp->pr_host, xp->pr_path); - - /* We are not printing an empty line here for state and name. */ >>> TRUNCATED FOR MAIL (1000 lines) <<<