CVS commit: src/usr.sbin/makemandb
Module Name:src Committed By: wiz Date: Fri Aug 1 12:55:00 UTC 2014 Modified Files: src/usr.sbin/makemandb: apropos-utils.c Log Message: Fix an off by one bug in apropos. The bug is in the html output where some garbage characters are seen in the context match output. From Abhinav Upadhyay in PR 49058. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/makemandb/apropos-utils.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makemandb/apropos-utils.c diff -u src/usr.sbin/makemandb/apropos-utils.c:1.15 src/usr.sbin/makemandb/apropos-utils.c:1.16 --- src/usr.sbin/makemandb/apropos-utils.c:1.15 Tue Apr 2 17:16:50 2013 +++ src/usr.sbin/makemandb/apropos-utils.c Fri Aug 1 12:55:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: apropos-utils.c,v 1.15 2013/04/02 17:16:50 christos Exp $ */ +/* $NetBSD: apropos-utils.c,v 1.16 2014/08/01 12:55:00 wiz Exp $ */ /*- * Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com * All rights reserved. @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: apropos-utils.c,v 1.15 2013/04/02 17:16:50 christos Exp $); +__RCSID($NetBSD: apropos-utils.c,v 1.16 2014/08/01 12:55:00 wiz Exp $); #include sys/queue.h #include sys/stat.h @@ -704,9 +704,9 @@ callback_html(void *data, const char *se break; } } - qsnippet[++i] = 0; + qsnippet[i] = 0; (*callback)(orig_data-data, section, name, name_desc, - (const char *)qsnippet, qsnippet_length); + (const char *)qsnippet, strlen(qsnippet)); free(qsnippet); return 0; }
CVS import: src/usr.bin/timeout
Module Name:src Committed By: christos Date: Fri Aug 1 13:50:55 UTC 2014 Update of /cvsroot/src/usr.bin/timeout In directory ivanova.netbsd.org:/tmp/cvs-serv17768 Log Message: import from FreeBSD Status: Vendor Tag: FreeBSD Release Tags: timeout-2014-08-01 N src/usr.bin/timeout/Makefile N src/usr.bin/timeout/timeout.1 N src/usr.bin/timeout/timeout.c No conflicts created by this import
CVS commit: src/usr.bin
Module Name:src Committed By: christos Date: Fri Aug 1 14:01:30 UTC 2014 Modified Files: src/usr.bin: Makefile src/usr.bin/timeout: Makefile timeout.1 timeout.c Log Message: PR/49053: Kamil Rytarowski: Import timeout(1) from FreeBSD To generate a diff of this commit: cvs rdiff -u -r1.217 -r1.218 src/usr.bin/Makefile cvs rdiff -u -r1.1.1.1 -r1.2 src/usr.bin/timeout/Makefile \ src/usr.bin/timeout/timeout.1 src/usr.bin/timeout/timeout.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/Makefile diff -u src/usr.bin/Makefile:1.217 src/usr.bin/Makefile:1.218 --- src/usr.bin/Makefile:1.217 Tue Apr 15 18:09:27 2014 +++ src/usr.bin/Makefile Fri Aug 1 10:01:30 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.217 2014/04/15 22:09:27 ginsbach Exp $ +# $NetBSD: Makefile,v 1.218 2014/08/01 14:01:30 christos Exp $ # from: @(#)Makefile 8.3 (Berkeley) 1/7/94 .include bsd.own.mk @@ -26,7 +26,8 @@ SUBDIR= apply asa at audio audiocfg \ rup ruptime rusers rwall rwho \ script sdiff sdpquery sed seq shar shlock \ showmount shuffle sockstat sort spell split stat su systat \ - tabs tail talk tcopy tee telnet tftp tic time tip touch tpfmt tput \ + tabs tail talk tcopy tee telnet tftp tic time timeout tip touch \ + tpfmt tput \ tr true tset tsort tty ul uname unexpand unifdef \ uniq units unvis unzip usbhidaction usbhidctl users utoppya \ uudecode uuencode uuidgen vacation vgrind videoctl vis \ Index: src/usr.bin/timeout/Makefile diff -u src/usr.bin/timeout/Makefile:1.1.1.1 src/usr.bin/timeout/Makefile:1.2 --- src/usr.bin/timeout/Makefile:1.1.1.1 Fri Aug 1 09:50:55 2014 +++ src/usr.bin/timeout/Makefile Fri Aug 1 10:01:30 2014 @@ -1,5 +1,6 @@ +# $NetBSD: Makefile,v 1.2 2014/08/01 14:01:30 christos Exp $ # $FreeBSD: head/usr.bin/timeout/Makefile 268745 2014-07-16 09:55:36Z bapt $ - +WARNS=6 PROG= timeout .include bsd.prog.mk Index: src/usr.bin/timeout/timeout.1 diff -u src/usr.bin/timeout/timeout.1:1.1.1.1 src/usr.bin/timeout/timeout.1:1.2 --- src/usr.bin/timeout/timeout.1:1.1.1.1 Fri Aug 1 09:50:55 2014 +++ src/usr.bin/timeout/timeout.1 Fri Aug 1 10:01:30 2014 @@ -1,3 +1,5 @@ +.\ $NetBSD: timeout.1,v 1.2 2014/08/01 14:01:30 christos Exp $ +.\ .\ Copyright (c) 2014 Baptiste Daroussin b...@freebsd.org .\ All rights reserved. .\ @@ -112,3 +114,17 @@ exits after receiving a signal, the exit .Sh SEE ALSO .Xr kill 1 , .Xr signal 3 +.Sh HISTORY +A +.Nm +utility appeared in a development branch of +.Fx 11 +and was imported into +.Nx 7 . +The +.Fx +work is compatible with GNU +.Xr timeout 1 +by Padraig Brady, from GNU Coreutils 8.21. The +.Xr timeout 1 +utility first appeared in GNU Coreutils 7.0. Index: src/usr.bin/timeout/timeout.c diff -u src/usr.bin/timeout/timeout.c:1.1.1.1 src/usr.bin/timeout/timeout.c:1.2 --- src/usr.bin/timeout/timeout.c:1.1.1.1 Fri Aug 1 09:50:55 2014 +++ src/usr.bin/timeout/timeout.c Fri Aug 1 10:01:30 2014 @@ -1,3 +1,5 @@ +/* $NetBSD: timeout.c,v 1.2 2014/08/01 14:01:30 christos Exp $ */ + /*- * Copyright (c) 2014 Baptiste Daroussin b...@freebsd.org * Copyright (c) 2014 Vsevolod Stakhov vsevo...@freebsd.org @@ -26,7 +28,13 @@ */ #include sys/cdefs.h +#if !defined(lint) +#if 0 __FBSDID($FreeBSD: head/usr.bin/timeout/timeout.c 268763 2014-07-16 13:52:05Z bapt $); +#else +__RCSID($NetBSD: timeout.c,v 1.2 2014/08/01 14:01:30 christos Exp $); +#endif +#endif /* not lint */ #include sys/time.h #include sys/wait.h @@ -34,6 +42,7 @@ __FBSDID($FreeBSD: head/usr.bin/timeout #include err.h #include errno.h #include getopt.h +#include limits.h #include signal.h #include stdbool.h #include stdio.h @@ -49,7 +58,7 @@ static sig_atomic_t sig_term = 0; static sig_atomic_t sig_alrm = 0; static sig_atomic_t sig_ign = 0; -static void +static void __dead usage(void) { @@ -101,21 +110,34 @@ parse_duration(const char *duration) static int parse_signal(const char *str) { - int sig, i; - const char *errstr; - - sig = strtonum(str, 0, sys_nsig, errstr); + long sig; + int i; + char *ep; - if (errstr == NULL) - return (sig); - if (strncasecmp(str, SIG, 3) == 0) + if (strncasecmp(str, SIG, 3) == 0) { str += 3; - for (i = 1; i sys_nsig; i++) { - if (strcasecmp(str, sys_signame[i]) == 0) - return (i); + for (i = 1; i sys_nsig; i++) { + if (strcasecmp(str, sys_signame[i]) == 0) +return (i); + } + + goto err; } + errno = 0; + sig = strtol(str, ep, 10); + + if (str[0] == '\0' || *ep != '\0') + goto err; + if (errno == ERANGE (sig == INT_MAX || sig == INT_MIN)) + goto err; + if (sig = sys_nsig || sig 0) + goto err; + + return (int)sig; + +err: errx(EX_USAGE, invalid signal); } @@ -151,7 +173,7 @@ set_interval(double iv) memset(tim, 0, sizeof(tim)); tim.it_value.tv_sec = (time_t)iv; - iv -= (time_t)iv; + iv -= (double)tim.it_value.tv_sec; tim.it_value.tv_usec = (suseconds_t)(iv * 100UL); if
CVS commit: src/doc
Module Name:src Committed By: christos Date: Fri Aug 1 14:05:35 UTC 2014 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: mention timeout To generate a diff of this commit: cvs rdiff -u -r1.1139 -r1.1140 src/doc/3RDPARTY cvs rdiff -u -r1.1955 -r1.1956 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1139 src/doc/3RDPARTY:1.1140 --- src/doc/3RDPARTY:1.1139 Thu Jul 31 10:05:57 2014 +++ src/doc/3RDPARTY Fri Aug 1 10:05:35 2014 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1139 2014/07/31 14:05:57 roy Exp $ +# $NetBSD: 3RDPARTY,v 1.1140 2014/08/01 14:05:35 christos Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -1538,3 +1538,14 @@ Notes: The kernel portion has been removed from the tar file. Our kernel smbfs and netsmb directories could move to external, but this is just make-work. + +Package: timeout +Version: FreeBSD-2014-08-01 +Current Vers: FreeBSD--YY-ZZ +Maintainer: Baptiste Daroussin b...@freebsd.org +Archive Site: none +Home Page: none +Mailing List: none +Responsible: christos +License: BSD-like (2-clause) +Location: usr.bin/timeout Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1955 src/doc/CHANGES:1.1956 --- src/doc/CHANGES:1.1955 Fri Aug 1 01:01:41 2014 +++ src/doc/CHANGES Fri Aug 1 10:05:35 2014 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: $Revision: 1.1955 $ +# LIST OF CHANGES FROM LAST RELEASE: $Revision: 1.1956 $ # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -457,3 +457,4 @@ Changes from NetBSD 6.0 to NetBSD 7.0: [dholland 20140725] arm: Add support for the Kobo touch (i.MX50). [hkenken 20140725] dhcpcd(8): Import dhcpcd-6.4.3 [roy 20140730] + timeout(1): Import from FreeBSD [christos 20140801]
CVS commit: src/distrib/sets/lists
Module Name:src Committed By: christos Date: Fri Aug 1 14:08:47 UTC 2014 Modified Files: src/distrib/sets/lists/base: mi src/distrib/sets/lists/debug: mi src/distrib/sets/lists/man: mi Log Message: add timeout(1) To generate a diff of this commit: cvs rdiff -u -r1.1078 -r1.1079 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.1480 -r1.1481 src/distrib/sets/lists/man/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.1078 src/distrib/sets/lists/base/mi:1.1079 --- src/distrib/sets/lists/base/mi:1.1078 Mon Jul 28 19:09:06 2014 +++ src/distrib/sets/lists/base/mi Fri Aug 1 10:08:47 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1078 2014/07/28 23:09:06 rjs Exp $ +# $NetBSD: mi,v 1.1079 2014/08/01 14:08:47 christos Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -729,6 +729,7 @@ ./usr/bin/tftp base-netutil-bin ./usr/bin/tic base-util-bin ./usr/bin/time base-util-bin +./usr/bin/timeoutbase-util-bin ./usr/bin/tip base-util-bin ./usr/bin/tmux base-util-bin ./usr/bin/tn3270base-obsolete obsolete Index: src/distrib/sets/lists/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.76 src/distrib/sets/lists/debug/mi:1.77 --- src/distrib/sets/lists/debug/mi:1.76 Sun Jul 27 06:19:12 2014 +++ src/distrib/sets/lists/debug/mi Fri Aug 1 10:08:47 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.76 2014/07/27 10:19:12 martin Exp $ +# $NetBSD: mi,v 1.77 2014/08/01 14:08:47 christos Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib @@ -760,6 +760,7 @@ ./usr/libdata/debug/usr/bin/tftp.debug comp-netutil-debug debug ./usr/libdata/debug/usr/bin/tic.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/time.debug comp-util-debug debug +./usr/libdata/debug/usr/bin/timeout.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/tip.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/tmux.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/tn3270.debug comp-obsolete obsolete Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1480 src/distrib/sets/lists/man/mi:1.1481 --- src/distrib/sets/lists/man/mi:1.1480 Thu Jul 24 17:08:50 2014 +++ src/distrib/sets/lists/man/mi Fri Aug 1 10:08:47 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1480 2014/07/24 21:08:50 alnsn Exp $ +# $NetBSD: mi,v 1.1481 2014/08/01 14:08:47 christos Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -554,6 +554,7 @@ ./usr/share/man/cat1/tftp.0 man-netutil-catman .cat ./usr/share/man/cat1/tic.0 man-util-catman .cat ./usr/share/man/cat1/time.0 man-util-catman .cat +./usr/share/man/cat1/timeout.0 man-util-catman .cat ./usr/share/man/cat1/tip.0 man-util-catman .cat ./usr/share/man/cat1/tmux.0 man-util-catman .cat ./usr/share/man/cat1/tn3270.0 man-obsolete obsolete @@ -3657,6 +3658,7 @@ ./usr/share/man/html1/tftp.html man-netutil-htmlman html ./usr/share/man/html1/tic.html man-util-htmlman html ./usr/share/man/html1/time.html man-util-htmlman html +./usr/share/man/html1/timeout.html man-util-htmlman html ./usr/share/man/html1/tip.html man-util-htmlman html ./usr/share/man/html1/tmux.html man-util-htmlman html ./usr/share/man/html1/tn3270.html man-obsolete obsolete @@ -6413,6 +6415,7 @@ ./usr/share/man/man1/tftp.1 man-netutil-man .man ./usr/share/man/man1/tic.1 man-util-man .man ./usr/share/man/man1/time.1 man-util-man .man +./usr/share/man/man1/timeout.1 man-util-man .man ./usr/share/man/man1/tip.1 man-util-man .man ./usr/share/man/man1/tmux.1 man-util-man .man ./usr/share/man/man1/tn3270.1 man-obsolete obsolete
CVS commit: src/sys/dev/pci
Module Name:src Committed By: joerg Date: Fri Aug 1 16:41:58 UTC 2014 Modified Files: src/sys/dev/pci: autri.c Log Message: Byte access is only used in the midi code. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/autri.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/autri.c diff -u src/sys/dev/pci/autri.c:1.51 src/sys/dev/pci/autri.c:1.52 --- src/sys/dev/pci/autri.c:1.51 Sat Mar 29 19:28:24 2014 +++ src/sys/dev/pci/autri.c Fri Aug 1 16:41:58 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: autri.c,v 1.51 2014/03/29 19:28:24 christos Exp $ */ +/* $NetBSD: autri.c,v 1.52 2014/08/01 16:41:58 joerg Exp $ */ /* * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: autri.c,v 1.51 2014/03/29 19:28:24 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: autri.c,v 1.52 2014/08/01 16:41:58 joerg Exp $); #include midi.h @@ -206,6 +206,7 @@ static const struct audio_format autri_f /* * register set/clear bit */ +#if NMIDI 0 static inline void autri_reg_set_1(struct autri_softc *sc, int no, uint8_t mask) { @@ -219,6 +220,7 @@ autri_reg_clear_1(struct autri_softc *sc bus_space_write_1(sc-memt, sc-memh, no, (bus_space_read_1(sc-memt, sc-memh, no) ~mask)); } +#endif static inline void autri_reg_set_4(struct autri_softc *sc, int no, uint32_t mask)
CVS commit: src/sys/arch/powerpc/include
Module Name:src Committed By: matt Date: Fri Aug 1 21:56:36 UTC 2014 Modified Files: src/sys/arch/powerpc/include: instr.h Log Message: Add OPC31_OR To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/instr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/include/instr.h diff -u src/sys/arch/powerpc/include/instr.h:1.6 src/sys/arch/powerpc/include/instr.h:1.7 --- src/sys/arch/powerpc/include/instr.h:1.6 Sat Feb 12 18:23:09 2011 +++ src/sys/arch/powerpc/include/instr.h Fri Aug 1 21:56:36 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: instr.h,v 1.6 2011/02/12 18:23:09 matt Exp $ */ +/* $NetBSD: instr.h,v 1.7 2014/08/01 21:56:36 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -315,6 +315,11 @@ union instr { #define OPC31_MTSPR 0x1d3 /* + * Opcode 31 sub-types (integer only) + */ +#define OPC31_OR 0x1bc + +/* * Opcode 59 sub-types: */
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: matt Date: Fri Aug 1 21:57:22 UTC 2014 Modified Files: src/sys/arch/powerpc/powerpc: fixup.c Log Message: Deal with the code LLVM generates for stubs. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/powerpc/fixup.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/powerpc/fixup.c diff -u src/sys/arch/powerpc/powerpc/fixup.c:1.8 src/sys/arch/powerpc/powerpc/fixup.c:1.9 --- src/sys/arch/powerpc/powerpc/fixup.c:1.8 Mon Mar 3 15:36:36 2014 +++ src/sys/arch/powerpc/powerpc/fixup.c Fri Aug 1 21:57:22 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: fixup.c,v 1.8 2014/03/03 15:36:36 macallan Exp $ */ +/* $NetBSD: fixup.c,v 1.9 2014/08/01 21:57:22 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,7 +36,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: fixup.c,v 1.8 2014/03/03 15:36:36 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: fixup.c,v 1.9 2014/08/01 21:57:22 matt Exp $); #include sys/param.h #include sys/types.h @@ -144,6 +144,15 @@ powerpc_fixup_stubs(uint32_t *start, uin ctr = fixreg[rs]; break; } +case OPC31_OR: { +#ifdef DIAGNOSTIC + KASSERT(valid_mask (1 rs)); + KASSERT(valid_mask (1 rb)); +#endif + fixreg[ra] = fixreg[rs] | fixreg[rb]; + valid_mask |= 1 ra; + break; +} default: panic(%s: %p: unexpected insn 0x%08x, __func__, stub, i.i_int); @@ -176,7 +185,7 @@ powerpc_fixup_stubs(uint32_t *start, uin break; } case OPC_STW: { -KASSERT(i.i_d.i_rs == r_lr i.i_d.i_ra == 1); +KASSERT((i.i_d.i_rs == r_lr || i.i_d.i_rs == 31) i.i_d.i_ra == 1); break; } case OPC_STWU: { @@ -195,6 +204,11 @@ powerpc_fixup_stubs(uint32_t *start, uin fixup.jfi_real = fixup_addr2offset(ctr); break; } + case OPC_RLWINM: { +// LLVM emits these for bool operands. +// Ignore them. +break; + } default: { panic(%s: %p: unexpected insn 0x%08x, __func__, stub, i.i_int);
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sat Aug 2 03:55:26 UTC 2014 Modified Files: src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c Log Message: restore splsoftnet() in various usrreqs that were removed during the PRU splits. we will properly review removal after the PRU split work is complete. To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.194 -r1.195 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.212 -r1.213 src/sys/netinet/udp_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet/raw_ip.c diff -u src/sys/netinet/raw_ip.c:1.139 src/sys/netinet/raw_ip.c:1.140 --- src/sys/netinet/raw_ip.c:1.139 Thu Jul 31 03:39:35 2014 +++ src/sys/netinet/raw_ip.c Sat Aug 2 03:55:26 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.139 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: raw_ip.c,v 1.140 2014/08/02 03:55:26 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.139 2014/07/31 03:39:35 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.140 2014/08/02 03:55:26 rtr Exp $); #include opt_inet.h #include opt_compat_netbsd.h @@ -618,8 +618,8 @@ rip_connect(struct socket *so, struct mb error = rip_connect_pcb(inp, nam); if (! error) soisconnected(so); - splx(s); + return error; } @@ -627,24 +627,33 @@ static int rip_disconnect(struct socket *so) { struct inpcb *inp = sotoinpcb(so); + int s; KASSERT(solocked(so)); KASSERT(inp != NULL); + s = splsoftnet(); soisdisconnected(so); rip_disconnect1(inp); + splx(s); + return 0; } static int rip_shutdown(struct socket *so) { + int s; + KASSERT(solocked(so)); /* * Mark the connection as being incapable of further input. */ + s = splsoftnet(); socantsendmore(so); + splx(s); + return 0; } @@ -676,22 +685,32 @@ rip_stat(struct socket *so, struct stat static int rip_peeraddr(struct socket *so, struct mbuf *nam) { + int s; + KASSERT(solocked(so)); KASSERT(sotoinpcb(so) != NULL); KASSERT(nam != NULL); + s = splsoftnet(); in_setpeeraddr(sotoinpcb(so), nam); + splx(s); + return 0; } static int rip_sockaddr(struct socket *so, struct mbuf *nam) { + int s; + KASSERT(solocked(so)); KASSERT(sotoinpcb(so) != NULL); KASSERT(nam != NULL); + s = splsoftnet(); in_setsockaddr(sotoinpcb(so), nam); + splx(s); + return 0; } Index: src/sys/netinet/tcp_usrreq.c diff -u src/sys/netinet/tcp_usrreq.c:1.194 src/sys/netinet/tcp_usrreq.c:1.195 --- src/sys/netinet/tcp_usrreq.c:1.194 Thu Jul 31 03:39:35 2014 +++ src/sys/netinet/tcp_usrreq.c Sat Aug 2 03:55:26 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.194 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.195 2014/08/02 03:55:26 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -99,7 +99,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.194 2014/07/31 03:39:35 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.195 2014/08/02 03:55:26 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -705,6 +705,7 @@ tcp_accept(struct socket *so, struct mbu struct tcpcb *tp = NULL; int ostate = 0; int error = 0; + int s; KASSERT(solocked(so)); @@ -718,6 +719,7 @@ tcp_accept(struct socket *so, struct mbu * done at higher levels; just return the address * of the peer, storing through addr. */ + s = splsoftnet(); #ifdef INET if (inp) { in_setpeeraddr(inp, nam); @@ -729,6 +731,7 @@ tcp_accept(struct socket *so, struct mbu } #endif tcp_debug_trace(so, tp, ostate, PRU_ACCEPT); + splx(s); return 0; } @@ -773,7 +776,6 @@ tcp_bind(struct socket *so, struct mbuf break; #endif } - tcp_debug_trace(so, tp, ostate, PRU_BIND); splx(s); @@ -786,9 +788,9 @@ tcp_listen(struct socket *so) struct inpcb *inp = NULL; struct in6pcb *in6p = NULL; struct tcpcb *tp = NULL; - int s; int error = 0; int ostate = 0; + int s; KASSERT(solocked(so)); @@ -841,8 +843,6 @@ tcp_connect(struct socket *so, struct mb ostate = tcp_debug_capture(tp, PRU_CONNECT); - s = splsoftnet(); - /* * Initiate connection to peer. * Create a template for use in transmissions on this connection. @@ -850,6 +850,7 @@ tcp_connect(struct socket *so, struct mb * Start keep-alive timer, and seed output sequence space. * Send initial segment on connection. */ + s = splsoftnet(); #ifdef INET if (inp) { if (inp-inp_lport == 0) { @@ -920,9 +921,9 @@ tcp_disconnect(struct socket *so) struct inpcb *inp = NULL; struct in6pcb *in6p = NULL; struct tcpcb *tp = NULL; - int s; int error = 0; int ostate = 0; + int s; KASSERT(solocked(so)); @@ -956,9 +957,9 @@ tcp_shutdown(struct socket *so) struct inpcb *inp = NULL; struct in6pcb *in6p =