CVS commit: src/tests/net/ipsec
Module Name:src Committed By: ozaki-r Date: Thu Jun 1 03:56:47 UTC 2017 Modified Files: src/tests/net/ipsec: t_ipsec_misc.sh Log Message: Test TCP communications over IPsec transport mode with ESP or AH This tests SP caches of PCB. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/net/ipsec/t_ipsec_misc.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/ipsec/t_ipsec_misc.sh diff -u src/tests/net/ipsec/t_ipsec_misc.sh:1.5 src/tests/net/ipsec/t_ipsec_misc.sh:1.6 --- src/tests/net/ipsec/t_ipsec_misc.sh:1.5 Thu Jun 1 03:51:47 2017 +++ src/tests/net/ipsec/t_ipsec_misc.sh Thu Jun 1 03:56:47 2017 @@ -1,4 +1,4 @@ -# $NetBSD: t_ipsec_misc.sh,v 1.5 2017/06/01 03:51:47 ozaki-r Exp $ +# $NetBSD: t_ipsec_misc.sh,v 1.6 2017/06/01 03:56:47 ozaki-r Exp $ # # Copyright (c) 2017 Internet Initiative Japan Inc. # All rights reserved. @@ -344,8 +344,13 @@ test_tcp() test_tcp_ipv4() { + local proto=$1 + local algo=$2 local ip_local=10.0.0.1 local ip_peer=10.0.0.2 + local algo_args="$(generate_algo_args $proto $algo)" + local proto_cap=$(echo $proto | tr 'a-z' 'A-Z') + local outfile=./out rump_server_crypto_start $SOCK_LOCAL netipsec rump_server_crypto_start $SOCK_PEER netipsec @@ -360,13 +365,36 @@ test_tcp_ipv4() atf_check -s exit:0 rump.ifconfig shmif0 $ip_peer/24 atf_check -s exit:0 rump.ifconfig -w 10 + if [ $proto != none ]; then + setup_sasp $proto "$algo_args" $ip_local $ip_peer 100 + fi + + extract_new_packets $BUS > $outfile + test_tcp ipv4 $ip_local $ip_peer + + extract_new_packets $BUS > $outfile + $DEBUG && cat $outfile + + if [ $proto != none ]; then + atf_check -s exit:0 \ + -o match:"$ip_local > $ip_peer: $proto_cap" \ + cat $outfile + atf_check -s exit:0 \ + -o match:"$ip_peer > $ip_local: $proto_cap" \ + cat $outfile + fi } test_tcp_ipv6() { + local proto=$1 + local algo=$2 local ip_local=fd00::1 local ip_peer=fd00::2 + local algo_args="$(generate_algo_args $proto $algo)" + local proto_cap=$(echo $proto | tr 'a-z' 'A-Z') + local outfile=./out rump_server_crypto_start $SOCK_LOCAL netinet6 netipsec rump_server_crypto_start $SOCK_PEER netinet6 netipsec @@ -381,16 +409,42 @@ test_tcp_ipv6() atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip_peer atf_check -s exit:0 rump.ifconfig -w 10 + if [ $proto != none ]; then + setup_sasp $proto "$algo_args" $ip_local $ip_peer 100 + fi + + extract_new_packets $BUS > $outfile + test_tcp ipv6 $ip_local $ip_peer + + extract_new_packets $BUS > $outfile + $DEBUG && cat $outfile + + if [ $proto != none ]; then + atf_check -s exit:0 \ + -o match:"$ip_local > $ip_peer: $proto_cap" \ + cat $outfile + atf_check -s exit:0 \ + -o match:"$ip_peer > $ip_local: $proto_cap" \ + cat $outfile + fi } add_test_tcp() { local ipproto=$1 + local proto=$2 + local algo=$3 + local _algo=$(echo $algo | sed 's/-//g') local name= desc= - name="ipsec_tcp_${ipproto}" - desc="Tests of TCP with IPsec enabled ($ipproto)" + if [ $proto = none ]; then + desc="Tests of TCP with IPsec enabled ($ipproto)" + name="ipsec_tcp_${ipproto}_${proto}" + else + desc="Tests of TCP with IPsec ($ipproto) $proto $algo" + name="ipsec_tcp_${ipproto}_${proto}_${_algo}" + fi atf_test_case ${name} cleanup eval "\ @@ -399,7 +453,7 @@ add_test_tcp() atf_set \"require.progs\" \"rump_server\" \"setkey\"; \ };\ ${name}_body() { \ - test_tcp_${ipproto}; \ + test_tcp_${ipproto} $proto $algo; \ rump_server_destroy_ifaces;\ };\ ${name}_cleanup() { \ @@ -417,12 +471,16 @@ atf_init_test_cases() for algo in $ESP_ENCRYPTION_ALGORITHMS_MINIMUM; do add_test_lifetime ipv4 esp $algo add_test_lifetime ipv6 esp $algo + add_test_tcp ipv4 esp $algo + add_test_tcp ipv6 esp $algo done for algo in $AH_AUTHENTICATION_ALGORITHMS_MINIMUM; do add_test_lifetime ipv4 ah $algo add_test_lifetime ipv6 ah $algo + add_test_tcp ipv4 ah $algo + add_test_tcp ipv6 ah $algo done - add_test_tcp ipv4 - add_test_tcp ipv6 + add_test_tcp ipv4 none + add_test_tcp ipv6 none }
CVS commit: src/tests/net/ipsec
Module Name:src Committed By: ozaki-r Date: Thu Jun 1 03:51:47 UTC 2017 Modified Files: src/tests/net/ipsec: t_ipsec_misc.sh Log Message: Remove a unused local variable To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/net/ipsec/t_ipsec_misc.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/ipsec/t_ipsec_misc.sh diff -u src/tests/net/ipsec/t_ipsec_misc.sh:1.4 src/tests/net/ipsec/t_ipsec_misc.sh:1.5 --- src/tests/net/ipsec/t_ipsec_misc.sh:1.4 Wed May 24 09:34:48 2017 +++ src/tests/net/ipsec/t_ipsec_misc.sh Thu Jun 1 03:51:47 2017 @@ -1,4 +1,4 @@ -# $NetBSD: t_ipsec_misc.sh,v 1.4 2017/05/24 09:34:48 ozaki-r Exp $ +# $NetBSD: t_ipsec_misc.sh,v 1.5 2017/06/01 03:51:47 ozaki-r Exp $ # # Copyright (c) 2017 Internet Initiative Japan Inc. # All rights reserved. @@ -167,7 +167,6 @@ test_ipsec6_lifetime() local algo=$2 local ip_local=fd00::1 local ip_peer=fd00::2 - local tmpfile=./tmp local outfile=./out local proto_cap=$(echo $proto | tr 'a-z' 'A-Z') local algo_args="$(generate_algo_args $proto $algo)"
CVS commit: src/sys/netipsec
Module Name:src Committed By: ozaki-r Date: Thu Jun 1 03:51:09 UTC 2017 Modified Files: src/sys/netipsec: key.c Log Message: Return a return value of key_senderror as usual To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/netipsec/key.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/netipsec/key.c diff -u src/sys/netipsec/key.c:1.159 src/sys/netipsec/key.c:1.160 --- src/sys/netipsec/key.c:1.159 Wed May 31 09:53:35 2017 +++ src/sys/netipsec/key.c Thu Jun 1 03:51:08 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.159 2017/05/31 09:53:35 ozaki-r Exp $ */ +/* $NetBSD: key.c,v 1.160 2017/06/01 03:51:08 ozaki-r Exp $ */ /* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */ /* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.159 2017/05/31 09:53:35 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.160 2017/06/01 03:51:08 ozaki-r Exp $"); /* * This code is referd to RFC 2367 @@ -2199,8 +2199,7 @@ key_spddelete2(struct socket *so, struct if (mhp->ext[SADB_X_EXT_POLICY] == NULL || mhp->extlen[SADB_X_EXT_POLICY] < sizeof(struct sadb_x_policy)) { IPSECLOG(LOG_DEBUG, "invalid message is passed.\n"); - key_senderror(so, m, EINVAL); - return 0; + return key_senderror(so, m, EINVAL); } id = ((struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY])->sadb_x_policy_id;
CVS commit: src/share/man/man8
Module Name:src Committed By: maya Date: Thu Jun 1 02:03:07 UTC 2017 Modified Files: src/share/man/man8: compat_ibcs2.8 Log Message: Omit mention of a script that doesn't actually exist anywhere pointed out by xmj, thanks To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/share/man/man8/compat_ibcs2.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man8/compat_ibcs2.8 diff -u src/share/man/man8/compat_ibcs2.8:1.8 src/share/man/man8/compat_ibcs2.8:1.9 --- src/share/man/man8/compat_ibcs2.8:1.8 Wed Jun 1 01:52:19 2016 +++ src/share/man/man8/compat_ibcs2.8 Thu Jun 1 02:03:07 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: compat_ibcs2.8,v 1.8 2016/06/01 01:52:19 pgoyette Exp $ +.\" $NetBSD: compat_ibcs2.8,v 1.9 2017/06/01 02:03:07 maya Exp $ .\" .\" Copyright (c) 1998 Scott Bartram .\" Copyright (c) 1995 Frank van der Linden @@ -32,7 +32,7 @@ .\" .\" Based on compat_linux.8 .\" -.Dd June 1, 2016 +.Dd June 1, 2017 .Dt COMPAT_IBCS2 8 .Os .Sh NAME @@ -168,15 +168,6 @@ sells a copy of SCO OpenServer (iBCS2) a personal/non-commercial use for only the cost of shipping (about $20US). The distribution comes on an ISO9660-format CDROM which can be mounted and used to copy the necessary files. -.Pp -Run the following script to copy the basic set of files from a SCO -distribution directory mounted somewhere locally: -.Bd -literal -/usr/share/examples/emul/ibcs2/ibcs2-setup [directory] -.Ed -.Pp -You should now be set up for SCO binaries which only need standard -shared libs. .Sh BUGS The information about SCO distributions may become outdated. .Pp
CVS commit: src
Module Name:src Committed By: chs Date: Wed May 31 23:54:17 UTC 2017 Modified Files: src/share/man/man9: percpu.9 src/sys/kern: subr_percpu.c Log Message: vmem_alloc() with VM_SLEEP cannot fail, so percpu_alloc() cannot fail either. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/percpu.9 cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_percpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/percpu.9 diff -u src/share/man/man9/percpu.9:1.11 src/share/man/man9/percpu.9:1.12 --- src/share/man/man9/percpu.9:1.11 Tue Mar 18 18:20:40 2014 +++ src/share/man/man9/percpu.9 Wed May 31 23:54:17 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: percpu.9,v 1.11 2014/03/18 18:20:40 riastradh Exp $ +.\" $NetBSD: percpu.9,v 1.12 2017/05/31 23:54:17 chs Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 23, 2010 +.Dd May 31, 2017 .Dt PERCPU 9 .Os .Sh NAME @@ -84,9 +84,7 @@ bytes of local storage on each CPU. The storage is initialized with zeroes. Treat this as an expensive operation. .Fn percpu_alloc -returns -.Dv NULL -on failure, and a handle for the per-CPU storage on success. +returns a handle for the per-CPU storage. .It Fn percpu_free "pc" "size" Call this in thread context to return to the system the per-CPU storage held by Index: src/sys/kern/subr_percpu.c diff -u src/sys/kern/subr_percpu.c:1.17 src/sys/kern/subr_percpu.c:1.18 --- src/sys/kern/subr_percpu.c:1.17 Thu Nov 27 15:00:00 2014 +++ src/sys/kern/subr_percpu.c Wed May 31 23:54:17 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_percpu.c,v 1.17 2014/11/27 15:00:00 uebayasi Exp $ */ +/* $NetBSD: subr_percpu.c,v 1.18 2017/05/31 23:54:17 chs Exp $ */ /*- * Copyright (c)2007,2008 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.17 2014/11/27 15:00:00 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.18 2017/05/31 23:54:17 chs Exp $"); #include #include @@ -257,9 +257,8 @@ percpu_alloc(size_t size) percpu_t *pc; ASSERT_SLEEPABLE(); - if (vmem_alloc(percpu_offset_arena, size, VM_SLEEP | VM_BESTFIT, - ) != 0) - return NULL; + (void)vmem_alloc(percpu_offset_arena, size, VM_SLEEP | VM_BESTFIT, + ); pc = (percpu_t *)percpu_encrypt((uintptr_t)offset); percpu_zero(pc, size); return pc;
CVS commit: src/sys/kern
Module Name:src Committed By: chs Date: Wed May 31 23:53:30 UTC 2017 Modified Files: src/sys/kern: subr_vmem.c Log Message: assert that vmem_alloc() with VM_SLEEP does not fail. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/kern/subr_vmem.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/kern/subr_vmem.c diff -u src/sys/kern/subr_vmem.c:1.95 src/sys/kern/subr_vmem.c:1.96 --- src/sys/kern/subr_vmem.c:1.95 Thu Jul 7 06:55:43 2016 +++ src/sys/kern/subr_vmem.c Wed May 31 23:53:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_vmem.c,v 1.95 2016/07/07 06:55:43 msaitoh Exp $ */ +/* $NetBSD: subr_vmem.c,v 1.96 2017/05/31 23:53:30 chs Exp $ */ /*- * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi, @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.95 2016/07/07 06:55:43 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.96 2017/05/31 23:53:30 chs Exp $"); #if defined(_KERNEL) && defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -1037,6 +1037,7 @@ int vmem_alloc(vmem_t *vm, vmem_size_t size, vm_flag_t flags, vmem_addr_t *addrp) { const vm_flag_t strat __diagused = flags & VM_FITMASK; + int error; KASSERT((flags & (VM_SLEEP|VM_NOSLEEP)) != 0); KASSERT((~flags & (VM_SLEEP|VM_NOSLEEP)) != 0); @@ -1056,12 +1057,16 @@ vmem_alloc(vmem_t *vm, vmem_size_t size, p = pool_cache_get(qc->qc_cache, vmf_to_prf(flags)); if (addrp != NULL) *addrp = (vmem_addr_t)p; - return (p == NULL) ? ENOMEM : 0; + error = (p == NULL) ? ENOMEM : 0; + goto out; } #endif /* defined(QCACHE) */ - return vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, + error = vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, flags, addrp); +out: + KASSERT(error == 0 || (flags & VM_SLEEP) == 0); + return error; } int
CVS commit: src/usr.bin/make
Module Name:src Committed By: maya Date: Wed May 31 22:02:06 UTC 2017 Modified Files: src/usr.bin/make: buf.h dir.h sprite.h Log Message: Don't prefix include guards by _, suggested by riastradh To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/buf.h cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/dir.h cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/sprite.h 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/make/buf.h diff -u src/usr.bin/make/buf.h:1.18 src/usr.bin/make/buf.h:1.19 --- src/usr.bin/make/buf.h:1.18 Wed May 31 21:15:47 2017 +++ src/usr.bin/make/buf.h Wed May 31 22:02:06 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: buf.h,v 1.18 2017/05/31 21:15:47 maya Exp $ */ +/* $NetBSD: buf.h,v 1.19 2017/05/31 22:02:06 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -77,8 +77,8 @@ * Header for users of the buf library. */ -#ifndef _MAKE_BUF_H -#define _MAKE_BUF_H +#ifndef MAKE_BUF_H +#define MAKE_BUF_H typedef char Byte; @@ -116,4 +116,4 @@ void Buf_Init(Buffer *, int); Byte *Buf_Destroy(Buffer *, Boolean); Byte *Buf_DestroyCompact(Buffer *); -#endif /* _MAKE_BUF_H */ +#endif /* MAKE_BUF_H */ Index: src/usr.bin/make/dir.h diff -u src/usr.bin/make/dir.h:1.17 src/usr.bin/make/dir.h:1.18 --- src/usr.bin/make/dir.h:1.17 Wed May 31 21:15:47 2017 +++ src/usr.bin/make/dir.h Wed May 31 22:02:06 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.17 2017/05/31 21:15:47 maya Exp $ */ +/* $NetBSD: dir.h,v 1.18 2017/05/31 22:02:06 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -75,8 +75,8 @@ /* dir.h -- */ -#ifndef _MAKE_DIR_H -#define _MAKE_DIR_H +#ifndef MAKE_DIR_H +#define MAKE_DIR_H typedef struct Path { char *name; /* Name of directory */ @@ -105,4 +105,4 @@ void Dir_PrintPath(Lst); void Dir_Destroy(void *); void * Dir_CopyDir(void *); -#endif /* _MAKE_DIR_H */ +#endif /* MAKE_DIR_H */ Index: src/usr.bin/make/sprite.h diff -u src/usr.bin/make/sprite.h:1.13 src/usr.bin/make/sprite.h:1.14 --- src/usr.bin/make/sprite.h:1.13 Wed May 31 21:15:47 2017 +++ src/usr.bin/make/sprite.h Wed May 31 22:02:06 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sprite.h,v 1.13 2017/05/31 21:15:47 maya Exp $ */ +/* $NetBSD: sprite.h,v 1.14 2017/05/31 22:02:06 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -78,8 +78,8 @@ * Common constants and type declarations for Sprite. */ -#ifndef _MAKE_SPRITE_H -#define _MAKE_SPRITE_H +#ifndef MAKE_SPRITE_H +#define MAKE_SPRITE_H /* @@ -113,4 +113,4 @@ typedef int ReturnStatus; #define SUCCESS 0x #define FAILURE 0x0001 -#endif /* _MAKE_SPRITE_H */ +#endif /* MAKE_SPRITE_H */
CVS commit: src/usr.bin/make
Module Name:src Committed By: maya Date: Wed May 31 21:15:47 UTC 2017 Modified Files: src/usr.bin/make: buf.h dir.h sprite.h Log Message: The previous change might actually be less generic. prepend by _MAKE, to be sure. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/buf.h cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/dir.h cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/sprite.h 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/make/buf.h diff -u src/usr.bin/make/buf.h:1.17 src/usr.bin/make/buf.h:1.18 --- src/usr.bin/make/buf.h:1.17 Tue Apr 24 20:26:58 2012 +++ src/usr.bin/make/buf.h Wed May 31 21:15:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: buf.h,v 1.17 2012/04/24 20:26:58 sjg Exp $ */ +/* $NetBSD: buf.h,v 1.18 2017/05/31 21:15:47 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -77,8 +77,8 @@ * Header for users of the buf library. */ -#ifndef _BUF_H -#define _BUF_H +#ifndef _MAKE_BUF_H +#define _MAKE_BUF_H typedef char Byte; @@ -116,4 +116,4 @@ void Buf_Init(Buffer *, int); Byte *Buf_Destroy(Buffer *, Boolean); Byte *Buf_DestroyCompact(Buffer *); -#endif /* _BUF_H */ +#endif /* _MAKE_BUF_H */ Index: src/usr.bin/make/dir.h diff -u src/usr.bin/make/dir.h:1.16 src/usr.bin/make/dir.h:1.17 --- src/usr.bin/make/dir.h:1.16 Wed May 31 21:07:03 2017 +++ src/usr.bin/make/dir.h Wed May 31 21:15:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.16 2017/05/31 21:07:03 maya Exp $ */ +/* $NetBSD: dir.h,v 1.17 2017/05/31 21:15:47 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -75,8 +75,8 @@ /* dir.h -- */ -#ifndef _DIR_H -#define _DIR_H +#ifndef _MAKE_DIR_H +#define _MAKE_DIR_H typedef struct Path { char *name; /* Name of directory */ @@ -105,4 +105,4 @@ void Dir_PrintPath(Lst); void Dir_Destroy(void *); void * Dir_CopyDir(void *); -#endif /* _DIR_H */ +#endif /* _MAKE_DIR_H */ Index: src/usr.bin/make/sprite.h diff -u src/usr.bin/make/sprite.h:1.12 src/usr.bin/make/sprite.h:1.13 --- src/usr.bin/make/sprite.h:1.12 Wed May 31 21:07:03 2017 +++ src/usr.bin/make/sprite.h Wed May 31 21:15:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sprite.h,v 1.12 2017/05/31 21:07:03 maya Exp $ */ +/* $NetBSD: sprite.h,v 1.13 2017/05/31 21:15:47 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -78,8 +78,8 @@ * Common constants and type declarations for Sprite. */ -#ifndef _SPRITE_H -#define _SPRITE_H +#ifndef _MAKE_SPRITE_H +#define _MAKE_SPRITE_H /* @@ -113,4 +113,4 @@ typedef int ReturnStatus; #define SUCCESS 0x #define FAILURE 0x0001 -#endif /* _SPRITE_H */ +#endif /* _MAKE_SPRITE_H */
CVS commit: src/usr.bin/make
Module Name:src Committed By: maya Date: Wed May 31 21:07:03 UTC 2017 Modified Files: src/usr.bin/make: dir.h hash.h sprite.h Log Message: Use less generic include guards To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/dir.h cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/hash.h src/usr.bin/make/sprite.h 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/make/dir.h diff -u src/usr.bin/make/dir.h:1.15 src/usr.bin/make/dir.h:1.16 --- src/usr.bin/make/dir.h:1.15 Sat Apr 7 18:29:08 2012 +++ src/usr.bin/make/dir.h Wed May 31 21:07:03 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.15 2012/04/07 18:29:08 christos Exp $ */ +/* $NetBSD: dir.h,v 1.16 2017/05/31 21:07:03 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -75,8 +75,8 @@ /* dir.h -- */ -#ifndef _DIR -#define _DIR +#ifndef _DIR_H +#define _DIR_H typedef struct Path { char *name; /* Name of directory */ @@ -105,4 +105,4 @@ void Dir_PrintPath(Lst); void Dir_Destroy(void *); void * Dir_CopyDir(void *); -#endif /* _DIR */ +#endif /* _DIR_H */ Index: src/usr.bin/make/hash.h diff -u src/usr.bin/make/hash.h:1.11 src/usr.bin/make/hash.h:1.12 --- src/usr.bin/make/hash.h:1.11 Tue Jun 7 00:40:00 2016 +++ src/usr.bin/make/hash.h Wed May 31 21:07:03 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.11 2016/06/07 00:40:00 sjg Exp $ */ +/* $NetBSD: hash.h,v 1.12 2017/05/31 21:07:03 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -78,8 +78,8 @@ * which maintains hash tables. */ -#ifndef _HASH -#define _HASH +#ifndef _HASH_H +#define _HASH_H /* * The following defines one entry in the hash table. @@ -146,4 +146,4 @@ void Hash_DeleteEntry(Hash_Table *, Hash Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *); Hash_Entry *Hash_EnumNext(Hash_Search *); -#endif /* _HASH */ +#endif /* _HASH_H */ Index: src/usr.bin/make/sprite.h diff -u src/usr.bin/make/sprite.h:1.11 src/usr.bin/make/sprite.h:1.12 --- src/usr.bin/make/sprite.h:1.11 Fri Jan 23 21:26:30 2009 +++ src/usr.bin/make/sprite.h Wed May 31 21:07:03 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sprite.h,v 1.11 2009/01/23 21:26:30 dsl Exp $ */ +/* $NetBSD: sprite.h,v 1.12 2017/05/31 21:07:03 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -78,8 +78,8 @@ * Common constants and type declarations for Sprite. */ -#ifndef _SPRITE -#define _SPRITE +#ifndef _SPRITE_H +#define _SPRITE_H /* @@ -113,4 +113,4 @@ typedef int ReturnStatus; #define SUCCESS 0x #define FAILURE 0x0001 -#endif /* _SPRITE */ +#endif /* _SPRITE_H */
CVS commit: src/lib/libpuffs
Module Name:src Committed By: christos Date: Wed May 31 17:56:01 UTC 2017 Modified Files: src/lib/libpuffs: framebuf.c puffs.c Log Message: Adjust to prototype. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/lib/libpuffs/framebuf.c cvs rdiff -u -r1.120 -r1.121 src/lib/libpuffs/puffs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpuffs/framebuf.c diff -u src/lib/libpuffs/framebuf.c:1.33 src/lib/libpuffs/framebuf.c:1.34 --- src/lib/libpuffs/framebuf.c:1.33 Tue May 9 17:15:30 2017 +++ src/lib/libpuffs/framebuf.c Wed May 31 13:56:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: framebuf.c,v 1.33 2017/05/09 21:15:30 christos Exp $ */ +/* $NetBSD: framebuf.c,v 1.34 2017/05/31 17:56:00 christos Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: framebuf.c,v 1.33 2017/05/09 21:15:30 christos Exp $"); +__RCSID("$NetBSD: framebuf.c,v 1.34 2017/05/31 17:56:00 christos Exp $"); #endif /* !lint */ #include @@ -559,7 +559,7 @@ puffs_framev_enqueue_waitevent(struct pu if (*what & PUFFS_FBIO_READ) if ((fio->stat & FIO_ENABLE_R) == 0) EV_SET(, fd, EVFILT_READ, EV_ENABLE, - 0, 0, (uintptr_t)fio); + 0, 0, (intptr_t)fio); if (kevent(pu->pu_kq, , 1, NULL, 0, NULL) == -1) return -1; @@ -578,7 +578,7 @@ puffs_framev_enqueue_waitevent(struct pu fio->rwait--; if (fio->rwait == 0 && (fio->stat & FIO_ENABLE_R) == 0) { EV_SET(, fd, EVFILT_READ, EV_DISABLE, - 0, 0, (uintptr_t)fio); + 0, 0, (intptr_t)fio); rv = kevent(pu->pu_kq, , 1, NULL, 0, NULL); #if 0 if (rv != 0) @@ -869,7 +869,7 @@ puffs_framev_enablefd(struct puffs_userm /* write is enabled in the event loop if there is output */ if (what & PUFFS_FBIO_READ && fio->rwait == 0) { - EV_SET(, fd, EVFILT_READ, EV_ENABLE, 0, 0, (uintptr_t)fio); + EV_SET(, fd, EVFILT_READ, EV_ENABLE, 0, 0, (intptr_t)fio); rv = kevent(pu->pu_kq, , 1, NULL, 0, NULL); } @@ -902,12 +902,12 @@ puffs_framev_disablefd(struct puffs_user i = 0; if (what & PUFFS_FBIO_READ && fio->rwait == 0) { EV_SET([0], fd, - EVFILT_READ, EV_DISABLE, 0, 0, (uintptr_t)fio); + EVFILT_READ, EV_DISABLE, 0, 0, (intptr_t)fio); i++; } if (what & PUFFS_FBIO_WRITE && fio->stat & FIO_WR && fio->wwait == 0) { EV_SET([1], fd, - EVFILT_WRITE, EV_DISABLE, 0, 0, (uintptr_t)fio); + EVFILT_WRITE, EV_DISABLE, 0, 0, (intptr_t)fio); i++; } if (i) Index: src/lib/libpuffs/puffs.c diff -u src/lib/libpuffs/puffs.c:1.120 src/lib/libpuffs/puffs.c:1.121 --- src/lib/libpuffs/puffs.c:1.120 Tue Jun 16 20:15:26 2015 +++ src/lib/libpuffs/puffs.c Wed May 31 13:56:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs.c,v 1.120 2015/06/17 00:15:26 christos Exp $ */ +/* $NetBSD: puffs.c,v 1.121 2017/05/31 17:56:00 christos Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -31,7 +31,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: puffs.c,v 1.120 2015/06/17 00:15:26 christos Exp $"); +__RCSID("$NetBSD: puffs.c,v 1.121 2017/05/31 17:56:00 christos Exp $"); #endif /* !lint */ #include @@ -846,14 +846,14 @@ puffs__theloop(struct puffs_cc *pcc) if (FIO_EN_WRITE(fio)) { EV_SET(>pu_evs[nchanges], fio->io_fd, EVFILT_WRITE, EV_ENABLE, 0, 0, -(uintptr_t)fio); +(intptr_t)fio); fio->stat |= FIO_WR; nchanges++; } if (FIO_RM_WRITE(fio)) { EV_SET(>pu_evs[nchanges], fio->io_fd, EVFILT_WRITE, EV_DISABLE, 0, 0, -(uintptr_t)fio); +(intptr_t)fio); fio->stat &= ~FIO_WR; nchanges++; } @@ -967,10 +967,10 @@ puffs_mainloop(struct puffs_usermount *p LIST_FOREACH(fio, >pu_ios, fio_entries) { EV_SET(curev, fio->io_fd, EVFILT_READ, EV_ADD, - 0, 0, (uintptr_t)fio); + 0, 0, (intptr_t)fio); curev++; EV_SET(curev, fio->io_fd, EVFILT_WRITE, EV_ADD | EV_DISABLE, - 0, 0, (uintptr_t)fio); + 0, 0, (intptr_t)fio); curev++; } for (i = 0; i < NSIG; i++) {
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: kre Date: Wed May 31 14:41:07 UTC 2017 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: And now do what 1.128 should have done, and put back the (now re-)used variable that had earlier been deleted, when it's use was removed in 1.126, but wasn't restored in 1.127. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130 src/sys/arch/x86/x86/cpu.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/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.129 src/sys/arch/x86/x86/cpu.c:1.130 --- src/sys/arch/x86/x86/cpu.c:1.129 Wed May 31 14:37:19 2017 +++ src/sys/arch/x86/x86/cpu.c Wed May 31 14:41:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.129 2017/05/31 14:37:19 kre Exp $ */ +/* $NetBSD: cpu.c,v 1.130 2017/05/31 14:41:07 kre Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.129 2017/05/31 14:37:19 kre Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.130 2017/05/31 14:41:07 kre Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -802,7 +802,7 @@ cpu_hatch(void *v) { struct cpu_info *ci = (struct cpu_info *)v; struct pcb *pcb; - int s; + int s, i; cpu_init_msrs(ci, true); cpu_probe(ci);
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: kre Date: Wed May 31 14:37:19 UTC 2017 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: Revert previous. Removing unused variable declarations is only a good idea when the variable is, in fact, unused. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/arch/x86/x86/cpu.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/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.128 src/sys/arch/x86/x86/cpu.c:1.129 --- src/sys/arch/x86/x86/cpu.c:1.128 Wed May 31 10:15:18 2017 +++ src/sys/arch/x86/x86/cpu.c Wed May 31 14:37:19 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.128 2017/05/31 10:15:18 pgoyette Exp $ */ +/* $NetBSD: cpu.c,v 1.129 2017/05/31 14:37:19 kre Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.128 2017/05/31 10:15:18 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.129 2017/05/31 14:37:19 kre Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -802,6 +802,7 @@ cpu_hatch(void *v) { struct cpu_info *ci = (struct cpu_info *)v; struct pcb *pcb; + int s; cpu_init_msrs(ci, true); cpu_probe(ci);
CVS commit: src/doc
Module Name:src Committed By: wiz Date: Wed May 31 14:18:36 UTC 2017 Modified Files: src/doc: 3RDPARTY Log Message: tmux-2.5 out. To generate a diff of this commit: cvs rdiff -u -r1.1443 -r1.1444 src/doc/3RDPARTY 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.1443 src/doc/3RDPARTY:1.1444 --- src/doc/3RDPARTY:1.1443 Thu May 25 00:12:34 2017 +++ src/doc/3RDPARTY Wed May 31 14:18:36 2017 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1443 2017/05/25 00:12:34 christos Exp $ +# $NetBSD: 3RDPARTY,v 1.1444 2017/05/31 14:18:36 wiz Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -1373,7 +1373,7 @@ purposes. Package: tmux Version: 2.4 -Current Vers: 2.4 +Current Vers: 2.5 Maintainer: Nicholas MarriottArchive site: https://github.com/tmux/tmux Home page: http://tmux.github.io
CVS commit: src/sys/net
Module Name:src Committed By: knakahara Date: Wed May 31 11:44:44 UTC 2017 Modified Files: src/sys/net: if_pppoe.h Log Message: add todo comment. pointed out by s-yamaguchi@IIJ To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/net/if_pppoe.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/net/if_pppoe.h diff -u src/sys/net/if_pppoe.h:1.13 src/sys/net/if_pppoe.h:1.14 --- src/sys/net/if_pppoe.h:1.13 Fri Apr 15 01:31:29 2016 +++ src/sys/net/if_pppoe.h Wed May 31 11:44:44 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_pppoe.h,v 1.13 2016/04/15 01:31:29 ozaki-r Exp $ */ +/* $NetBSD: if_pppoe.h,v 1.14 2017/05/31 11:44:44 knakahara Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -69,5 +69,11 @@ struct pppoeconnectionstate { void pppoe_input(struct ifnet *, struct mbuf *); void pppoedisc_input(struct ifnet *, struct mbuf *); #endif /* _KERNEL */ +/* + * TODO: Locking notes + * Currently, the if_pppoe.c and if_spppsubr.c locking is too complexity. + * So, we will restructure locks, and then we describe the restructureed + * locking note. + */ #endif /* !_NET_IF_PPPOE_H_ */
CVS commit: src/sys/arch/sparc/include
Module Name:src Committed By: martin Date: Wed May 31 11:09:22 UTC 2017 Modified Files: src/sys/arch/sparc/include: profile.h Log Message: Fix __PIC__ profiled binaries To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sparc/include/profile.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/sparc/include/profile.h diff -u src/sys/arch/sparc/include/profile.h:1.16 src/sys/arch/sparc/include/profile.h:1.17 --- src/sys/arch/sparc/include/profile.h:1.16 Thu Sep 12 15:36:17 2013 +++ src/sys/arch/sparc/include/profile.h Wed May 31 11:09:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.h,v 1.16 2013/09/12 15:36:17 joerg Exp $ */ +/* $NetBSD: profile.h,v 1.17 2017/05/31 11:09:22 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -57,7 +57,6 @@ __asm("add %o7, 8, %o1");\ __asm("1: rd %pc, %o2");\ __asm("add %o2," _MCOUNT_SYM "-1b, %o2");\ - __asm("ld [%o2], %o2");\ __asm("jmpl %o2, %g0");\ __asm("add %i7, 8, %o0"); #else @@ -65,9 +64,10 @@ __asm(".global " _MCOUNT_ENTRY);\ __asm(_MCOUNT_ENTRY ":");\ __asm("add %o7, 8, %o1");\ + __asm("mov %o7, %o3");\ __asm("1: call 2f; nop; 2:");\ __asm("add %o7," _MCOUNT_SYM "-1b, %o2");\ - __asm("ld [%o2], %o2");\ + __asm("mov %o3, %o7");\ __asm("jmpl %o2, %g0");\ __asm("add %i7, 8, %o0"); #endif
CVS commit: src/tests/usr.bin/cc
Module Name:src Committed By: martin Date: Wed May 31 11:08:35 UTC 2017 Modified Files: src/tests/usr.bin/cc: t_hello.sh Log Message: In the -m32 test, additionally test profiled binaries. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/cc/t_hello.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/cc/t_hello.sh diff -u src/tests/usr.bin/cc/t_hello.sh:1.5 src/tests/usr.bin/cc/t_hello.sh:1.6 --- src/tests/usr.bin/cc/t_hello.sh:1.5 Thu May 18 10:29:47 2017 +++ src/tests/usr.bin/cc/t_hello.sh Wed May 31 11:08:35 2017 @@ -1,4 +1,4 @@ -# $NetBSD: t_hello.sh,v 1.5 2017/05/18 10:29:47 martin Exp $ +# $NetBSD: t_hello.sh,v 1.6 2017/05/31 11:08:35 martin Exp $ # # Copyright (c) 2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -149,6 +149,16 @@ EOF atf_check -s exit:0 -o ignore -e ignore cc -o hello -m32 \ -static test.c atf_check -s exit:0 -o inline:"hello static world\n" ./hello + + # and another test with profile 32bit binaries + cat > test.c << EOF +#include +#include +int main(void) {printf("hello 32bit profile world\n");exit(0);} +EOF + atf_check -s exit:0 -o ignore -e ignore cc -o hello -m32 \ + -pg test.c + atf_check -s exit:0 -o inline:"hello 32bit profile world\n" ./hello } atf_init_test_cases()
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: pgoyette Date: Wed May 31 10:15:18 UTC 2017 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: Remove unused variabe (I reverted too much in previous commit!) To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128 src/sys/arch/x86/x86/cpu.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/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.127 src/sys/arch/x86/x86/cpu.c:1.128 --- src/sys/arch/x86/x86/cpu.c:1.127 Wed May 31 10:08:24 2017 +++ src/sys/arch/x86/x86/cpu.c Wed May 31 10:15:18 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.127 2017/05/31 10:08:24 pgoyette Exp $ */ +/* $NetBSD: cpu.c,v 1.128 2017/05/31 10:15:18 pgoyette Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.127 2017/05/31 10:08:24 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.128 2017/05/31 10:15:18 pgoyette Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -802,7 +802,6 @@ cpu_hatch(void *v) { struct cpu_info *ci = (struct cpu_info *)v; struct pcb *pcb; - int s; cpu_init_msrs(ci, true); cpu_probe(ci);
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: pgoyette Date: Wed May 31 10:08:24 UTC 2017 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: Partially revert previous. Rather than completely removing the loop around calls to x86_pause(), just drastically reduce the repeat count. It's still good to have some real delay here (among other things, for letting the TSCs drift). As discussed on IRC To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/sys/arch/x86/x86/cpu.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/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.126 src/sys/arch/x86/x86/cpu.c:1.127 --- src/sys/arch/x86/x86/cpu.c:1.126 Wed May 31 00:19:17 2017 +++ src/sys/arch/x86/x86/cpu.c Wed May 31 10:08:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.126 2017/05/31 00:19:17 maya Exp $ */ +/* $NetBSD: cpu.c,v 1.127 2017/05/31 10:08:24 pgoyette Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.126 2017/05/31 00:19:17 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.127 2017/05/31 10:08:24 pgoyette Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -835,7 +835,9 @@ cpu_hatch(void *v) } x86_mwait(0, 0); } else { - x86_pause(); + for (i = 100; i != 0; i--) { +x86_pause(); + } } }
CVS commit: src/sys/netipsec
Module Name:src Committed By: ozaki-r Date: Wed May 31 09:53:35 UTC 2017 Modified Files: src/sys/netipsec: key.c Log Message: Split the timer handler into small functions (NFC) To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/netipsec/key.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/netipsec/key.c diff -u src/sys/netipsec/key.c:1.158 src/sys/netipsec/key.c:1.159 --- src/sys/netipsec/key.c:1.158 Wed May 31 09:52:43 2017 +++ src/sys/netipsec/key.c Wed May 31 09:53:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.158 2017/05/31 09:52:43 ozaki-r Exp $ */ +/* $NetBSD: key.c,v 1.159 2017/05/31 09:53:35 ozaki-r Exp $ */ /* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */ /* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.158 2017/05/31 09:52:43 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.159 2017/05/31 09:53:35 ozaki-r Exp $"); /* * This code is referd to RFC 2367 @@ -4477,23 +4477,10 @@ key_bb_match_withmask(const void *a1, co return 1; /* Match! */ } -/* - * time handler. - * scanning SPD and SAD to check status for each entries, - * and do to remove or to expire. - */ static void -key_timehandler_work(struct work *wk, void *arg) +key_timehandler_spd(time_t now) { u_int dir; - int s; - time_t now = time_uptime; - - s = splsoftnet(); - mutex_enter(softnet_lock); - - /* SPD */ -{ struct secpolicy *sp, *nextsp; for (dir = 0; dir < IPSEC_DIR_MAX; dir++) { @@ -4519,10 +4506,11 @@ key_timehandler_work(struct work *wk, vo } } } -} +} - /* SAD */ -{ +static void +key_timehandler_sad(time_t now) +{ struct secashead *sah, *nextsah; struct secasvar *sav, *nextsav; @@ -4661,11 +4649,12 @@ key_timehandler_work(struct work *wk, vo */ } } -} +} +static void +key_timehandler_acq(time_t now) +{ #ifndef IPSEC_NONBLOCK_ACQUIRE - /* ACQ tree */ -{ struct secacq *acq, *nextacq; restart: @@ -4679,12 +4668,13 @@ key_timehandler_work(struct work *wk, vo } } mutex_exit(_mtx); -} #endif +} +static void +key_timehandler_spacq(time_t now) +{ #ifdef notyet - /* SP ACQ tree */ -{ struct secspacq *acq, *nextacq; LIST_FOREACH_SAFE(acq, , chain, nextacq) { @@ -4694,8 +4684,27 @@ key_timehandler_work(struct work *wk, vo kmem_free(acq, sizeof(*acq)); } } -} #endif +} + +/* + * time handler. + * scanning SPD and SAD to check status for each entries, + * and do to remove or to expire. + */ +static void +key_timehandler_work(struct work *wk, void *arg) +{ + int s; + time_t now = time_uptime; + + s = splsoftnet(); + mutex_enter(softnet_lock); + + key_timehandler_spd(now); + key_timehandler_sad(now); + key_timehandler_acq(now); + key_timehandler_spacq(now); /* do exchange to tick time !! */ callout_reset(_timehandler_ch, hz, key_timehandler, NULL);
CVS commit: src/sys/netipsec
Module Name:src Committed By: ozaki-r Date: Wed May 31 09:52:43 UTC 2017 Modified Files: src/sys/netipsec: key.c Log Message: Introduce key_fill_replymsg to dedup some routines To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/netipsec/key.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/netipsec/key.c diff -u src/sys/netipsec/key.c:1.157 src/sys/netipsec/key.c:1.158 --- src/sys/netipsec/key.c:1.157 Wed May 31 09:51:31 2017 +++ src/sys/netipsec/key.c Wed May 31 09:52:43 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.157 2017/05/31 09:51:31 ozaki-r Exp $ */ +/* $NetBSD: key.c,v 1.158 2017/05/31 09:52:43 ozaki-r Exp $ */ /* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */ /* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.157 2017/05/31 09:51:31 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.158 2017/05/31 09:52:43 ozaki-r Exp $"); /* * This code is referd to RFC 2367 @@ -369,6 +369,25 @@ key_msghdr_get_sockaddr(const struct sad return PFKEY_ADDR_SADDR((struct sadb_address *)mhp->ext[idx]); } +static struct mbuf * +key_fill_replymsg(struct mbuf *m, int seq) +{ + struct sadb_msg *msg; + + if (m->m_len < sizeof(*msg)) { + m = m_pullup(m, sizeof(*msg)); + if (m == NULL) + return NULL; + } + msg = mtod(m, struct sadb_msg *); + msg->sadb_msg_errno = 0; + msg->sadb_msg_len = PFKEY_UNIT64(m->m_pkthdr.len); + if (seq != 0) + msg->sadb_msg_seq = seq; + + return m; +} + static struct secasvar *key_allocsa_policy (const struct secasindex *); #if 0 static void key_freeso(struct socket *); @@ -1991,7 +2010,6 @@ key_spdadd(struct socket *so, struct mbu { struct mbuf *n, *mpolicy; - struct sadb_msg *newmsg; int off; /* create new sadb_msg to reply. */ @@ -2007,14 +2025,9 @@ key_spdadd(struct socket *so, struct mbu if (!n) return key_senderror(so, m, ENOBUFS); - if (n->m_len < sizeof(*newmsg)) { - n = m_pullup(n, sizeof(*newmsg)); - if (!n) - return key_senderror(so, m, ENOBUFS); - } - newmsg = mtod(n, struct sadb_msg *); - newmsg->sadb_msg_errno = 0; - newmsg->sadb_msg_len = PFKEY_UNIT64(n->m_pkthdr.len); + n = key_fill_replymsg(n, 0); + if (n == NULL) + return key_senderror(so, m, ENOBUFS); off = 0; mpolicy = m_pulldown(n, PFKEY_ALIGN8(sizeof(struct sadb_msg)), @@ -2142,7 +2155,6 @@ key_spddelete(struct socket *so, struct { struct mbuf *n; - struct sadb_msg *newmsg; /* create new sadb_msg to reply. */ n = key_gather_mbuf(m, mhp, 1, 4, SADB_EXT_RESERVED, @@ -2150,9 +2162,9 @@ key_spddelete(struct socket *so, struct if (!n) return key_senderror(so, m, ENOBUFS); - newmsg = mtod(n, struct sadb_msg *); - newmsg->sadb_msg_errno = 0; - newmsg->sadb_msg_len = PFKEY_UNIT64(n->m_pkthdr.len); + n = key_fill_replymsg(n, 0); + if (n == NULL) + return key_senderror(so, m, ENOBUFS); m_freem(m); key_update_used(); @@ -2212,7 +2224,6 @@ key_spddelete2(struct socket *so, struct { struct mbuf *n, *nn; - struct sadb_msg *newmsg; int off, len; CTASSERT(PFKEY_ALIGN8(sizeof(struct sadb_msg)) <= MCLBYTES); @@ -2251,9 +2262,9 @@ key_spddelete2(struct socket *so, struct for (nn = n; nn; nn = nn->m_next) n->m_pkthdr.len += nn->m_len; - newmsg = mtod(n, struct sadb_msg *); - newmsg->sadb_msg_errno = 0; - newmsg->sadb_msg_len = PFKEY_UNIT64(n->m_pkthdr.len); + n = key_fill_replymsg(n, 0); + if (n == NULL) + return key_senderror(so, m, ENOBUFS); m_freem(m); return key_sendup_mbuf(so, n, KEY_SENDUP_ALL); @@ -4932,7 +4943,6 @@ key_getspi(struct socket *so, struct mbu { struct mbuf *n, *nn; struct sadb_sa *m_sa; - struct sadb_msg *newmsg; int off, len; CTASSERT(PFKEY_ALIGN8(sizeof(struct sadb_msg)) + @@ -4985,10 +4995,7 @@ key_getspi(struct socket *so, struct mbu for (nn = n; nn; nn = nn->m_next) n->m_pkthdr.len += nn->m_len; - newmsg = mtod(n, struct sadb_msg *); - newmsg->sadb_msg_seq = newsav->seq; - newmsg->sadb_msg_errno = 0; - newmsg->sadb_msg_len = PFKEY_UNIT64(n->m_pkthdr.len); + key_fill_replymsg(n, newsav->seq); m_freem(m); return key_sendup_mbuf(so, n, KEY_SENDUP_ONE); @@ -5736,7 +5743,6 @@ key_delete(struct socket *so, struct mbu { struct mbuf *n; - struct sadb_msg *newmsg; /* create new sadb_msg to reply. */ n = key_gather_mbuf(m, mhp, 1, 4, SADB_EXT_RESERVED, @@ -5744,14 +5750,9 @@ key_delete(struct socket *so, struct mbu if (!n) return key_senderror(so, m, ENOBUFS); - if (n->m_len < sizeof(struct sadb_msg)) { - n = m_pullup(n, sizeof(struct sadb_msg)); - if (n == NULL) - return key_senderror(so, m, ENOBUFS); - } - newmsg = mtod(n, struct sadb_msg *); - newmsg->sadb_msg_errno = 0; - newmsg->sadb_msg_len = PFKEY_UNIT64(n->m_pkthdr.len); + n = key_fill_replymsg(n, 0); + if (n == NULL) + return key_senderror(so, m,
CVS commit: src/sys/netipsec
Module Name:src Committed By: ozaki-r Date: Wed May 31 09:51:31 UTC 2017 Modified Files: src/sys/netipsec: key.c Log Message: Convert some sanity checks to CTASSERT To generate a diff of this commit: cvs rdiff -u -r1.156 -r1.157 src/sys/netipsec/key.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/netipsec/key.c diff -u src/sys/netipsec/key.c:1.156 src/sys/netipsec/key.c:1.157 --- src/sys/netipsec/key.c:1.156 Wed May 31 09:50:04 2017 +++ src/sys/netipsec/key.c Wed May 31 09:51:31 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.156 2017/05/31 09:50:04 ozaki-r Exp $ */ +/* $NetBSD: key.c,v 1.157 2017/05/31 09:51:31 ozaki-r Exp $ */ /* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */ /* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.156 2017/05/31 09:50:04 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.157 2017/05/31 09:51:31 ozaki-r Exp $"); /* * This code is referd to RFC 2367 @@ -2215,11 +2215,11 @@ key_spddelete2(struct socket *so, struct struct sadb_msg *newmsg; int off, len; + CTASSERT(PFKEY_ALIGN8(sizeof(struct sadb_msg)) <= MCLBYTES); + /* create new sadb_msg to reply. */ len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); - if (len > MCLBYTES) - return key_senderror(so, m, ENOBUFS); MGETHDR(n, M_DONTWAIT, MT_DATA); if (n && len > MHLEN) { MCLGET(n, M_DONTWAIT); @@ -3798,9 +3798,10 @@ key_setsadbmsg(u_int8_t type, u_int16_t struct sadb_msg *p; int len; + CTASSERT(PFKEY_ALIGN8(sizeof(struct sadb_msg)) <= MCLBYTES); + len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); - if (len > MCLBYTES) - return NULL; + MGETHDR(m, M_DONTWAIT, MT_DATA); if (m && len > MHLEN) { MCLGET(m, M_DONTWAIT); @@ -4934,11 +4935,12 @@ key_getspi(struct socket *so, struct mbu struct sadb_msg *newmsg; int off, len; + CTASSERT(PFKEY_ALIGN8(sizeof(struct sadb_msg)) + + PFKEY_ALIGN8(sizeof(struct sadb_sa)) <= MCLBYTES); + /* create new sadb_msg to reply. */ len = PFKEY_ALIGN8(sizeof(struct sadb_msg)) + PFKEY_ALIGN8(sizeof(struct sadb_sa)); - if (len > MCLBYTES) - return key_senderror(so, m, ENOBUFS); MGETHDR(n, M_DONTWAIT, MT_DATA); if (len > MHLEN) {
CVS commit: src/sys/netipsec
Module Name:src Committed By: ozaki-r Date: Wed May 31 09:50:04 UTC 2017 Modified Files: src/sys/netipsec: key.c Log Message: Move key_init_spidx_bymsghdr to just before spidx is used (NFC) To generate a diff of this commit: cvs rdiff -u -r1.155 -r1.156 src/sys/netipsec/key.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/netipsec/key.c diff -u src/sys/netipsec/key.c:1.155 src/sys/netipsec/key.c:1.156 --- src/sys/netipsec/key.c:1.155 Wed May 31 05:05:38 2017 +++ src/sys/netipsec/key.c Wed May 31 09:50:04 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.155 2017/05/31 05:05:38 ozaki-r Exp $ */ +/* $NetBSD: key.c,v 1.156 2017/05/31 09:50:04 ozaki-r Exp $ */ /* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */ /* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.155 2017/05/31 05:05:38 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.156 2017/05/31 09:50:04 ozaki-r Exp $"); /* * This code is referd to RFC 2367 @@ -2106,9 +2106,6 @@ key_spddelete(struct socket *so, struct return key_senderror(so, m, EINVAL); } - /* make secindex */ - key_init_spidx_bymsghdr(, mhp); - xpl0 = (struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY]; /* checking the direciton. */ @@ -2121,6 +2118,9 @@ key_spddelete(struct socket *so, struct return key_senderror(so, m, EINVAL); } + /* make secindex */ + key_init_spidx_bymsghdr(, mhp); + /* Is there SP in SPD ? */ sp = key_getsp(); if (sp == NULL) {
CVS commit: src/sys/net
Module Name:src Committed By: knakahara Date: Wed May 31 08:19:44 UTC 2017 Modified Files: src/sys/net: if_l2tp.h Log Message: remove obsoleted comment. pointed out by s-yamaguchi@IIJ. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/net/if_l2tp.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/net/if_l2tp.h diff -u src/sys/net/if_l2tp.h:1.1 src/sys/net/if_l2tp.h:1.2 --- src/sys/net/if_l2tp.h:1.1 Thu Feb 16 08:23:35 2017 +++ src/sys/net/if_l2tp.h Wed May 31 08:19:44 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_l2tp.h,v 1.1 2017/02/16 08:23:35 knakahara Exp $ */ +/* $NetBSD: if_l2tp.h,v 1.2 2017/05/31 08:19:44 knakahara Exp $ */ /* * Copyright (c) 2017 Internet Initiative Japan Inc. @@ -201,8 +201,8 @@ struct mbuf *l2tp_tcpmss_clamp(struct if * NOTICE * - l2tp_softc must not have a variant value while the l2tp tunnel exists. * Such variant values must be in l2tp_softc->l2tp_var. - * - l2tp_softc->l2tp_var is modified by atomic_swap_ptr() like - * read-copy-update. So, once we dereference l2tp_softc->l2tp_var, we must + * - l2tp_softc->l2tp_var is modified like read-copy-update. + * So, once we dereference l2tp_softc->l2tp_var, we must * keep the pointer during the same context. If we re-derefence * l2tp_softc->l2tp_var, the l2tp_var may be other one because of * concurrent writer processing.