CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Tue Nov 10 17:59:37 UTC 2015 Modified Files: src/sys/net: if_gif.c Log Message: CID 980463: Provide common error path for rollback. Remove extra check for success. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/net/if_gif.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/net/if_gif.c diff -u src/sys/net/if_gif.c:1.88 src/sys/net/if_gif.c:1.89 --- src/sys/net/if_gif.c:1.88 Mon Aug 24 18:21:26 2015 +++ src/sys/net/if_gif.c Tue Nov 10 12:59:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gif.c,v 1.88 2015/08/24 22:21:26 pooka Exp $ */ +/* $NetBSD: if_gif.c,v 1.89 2015/11/10 17:59:37 christos Exp $ */ /* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.88 2015/08/24 22:21:26 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.89 2015/11/10 17:59:37 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -669,6 +669,8 @@ gif_set_tunnel(struct ifnet *ifp, struct s = splsoftnet(); + osrc = sc->gif_psrc; + odst = sc->gif_pdst; LIST_FOREACH(sc2, _softc_list, gif_list) { if (sc2 == sc) continue; @@ -704,17 +706,23 @@ gif_set_tunnel(struct ifnet *ifp, struct #endif } + sc->gif_psrc = sc->gif_pdst = NULL; + sc->gif_si = softint_establish(SOFTINT_NET, gifintr, sc); if (sc->gif_si == NULL) { error = ENOMEM; goto bad; } - osrc = sc->gif_psrc; - sc->gif_psrc = sockaddr_dup(src, M_WAITOK); + if ((sc->gif_psrc = sockaddr_dup(src, M_WAITOK)) == NULL) { + error = ENOMEM; + goto bad; + } - odst = sc->gif_pdst; - sc->gif_pdst = sockaddr_dup(dst, M_WAITOK); + if ((sc->gif_pdst = sockaddr_dup(dst, M_WAITOK)) == NULL) { + error = ENOMEM; + goto bad; + } switch (sc->gif_psrc->sa_family) { #ifdef INET @@ -731,33 +739,33 @@ gif_set_tunnel(struct ifnet *ifp, struct error = EINVAL; break; } - if (error) { - /* rollback */ - sockaddr_free(sc->gif_psrc); - sockaddr_free(sc->gif_pdst); - sc->gif_psrc = osrc; - sc->gif_pdst = odst; + if (error) goto bad; - } if (osrc) sockaddr_free(osrc); if (odst) sockaddr_free(odst); - if (sc->gif_psrc && sc->gif_pdst) - ifp->if_flags |= IFF_RUNNING; - else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_flags |= IFF_RUNNING; splx(s); return 0; bad: + /* rollback */ + if (sc->gif_psrc != NULL) + sockaddr_free(sc->gif_psrc); + if (sc->gif_pdst != NULL) + sockaddr_free(sc->gif_pdst); + sc->gif_psrc = osrc; + sc->gif_pdst = odst; + if (sc->gif_si) { softint_disestablish(sc->gif_si); sc->gif_si = NULL; } + if (sc->gif_psrc && sc->gif_pdst) ifp->if_flags |= IFF_RUNNING; else
CVS commit: src/lib/libc/rpc
Module Name:src Committed By: christos Date: Tue Nov 10 18:06:53 UTC 2015 Modified Files: src/lib/libc/rpc: svc_run.c Log Message: CID 1338515: Make it clear that the pfd variable can't be NULL To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/libc/rpc/svc_run.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/libc/rpc/svc_run.c diff -u src/lib/libc/rpc/svc_run.c:1.25 src/lib/libc/rpc/svc_run.c:1.26 --- src/lib/libc/rpc/svc_run.c:1.25 Sat Nov 7 18:09:20 2015 +++ src/lib/libc/rpc/svc_run.c Tue Nov 10 13:06:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_run.c,v 1.25 2015/11/07 23:09:20 christos Exp $ */ +/* $NetBSD: svc_run.c,v 1.26 2015/11/10 18:06:53 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)svc_run.c 2.1 88/07/29 4.0 RPCSRC"; #else -__RCSID("$NetBSD: svc_run.c,v 1.25 2015/11/07 23:09:20 christos Exp $"); +__RCSID("$NetBSD: svc_run.c,v 1.26 2015/11/10 18:06:53 christos Exp $"); #endif #endif @@ -156,7 +156,7 @@ svc_run_poll(void) goto out; } - if (fdsize != svc_pollfd_getsize(0)) { + if (pdf == NULL || fdsize != svc_pollfd_getsize(0)) { fdsize = svc_fdset_getsize(0); free(pfd); pfd = svc_pollfd_copy(svc_pollfd_get());
CVS commit: src/lib/libc/rpc
Module Name:src Committed By: christos Date: Tue Nov 10 18:11:05 UTC 2015 Modified Files: src/lib/libc/rpc: svc_fdset.c Log Message: CID 1338520: Check NULL CID 1338521: Fix error (realloc returns different pointer) To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/rpc/svc_fdset.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/libc/rpc/svc_fdset.c diff -u src/lib/libc/rpc/svc_fdset.c:1.13 src/lib/libc/rpc/svc_fdset.c:1.14 --- src/lib/libc/rpc/svc_fdset.c:1.13 Tue Nov 10 13:08:05 2015 +++ src/lib/libc/rpc/svc_fdset.c Tue Nov 10 13:11:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $ */ +/* $NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $"); +__RCSID("$NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $"); #include "reentrant.h" @@ -215,6 +215,7 @@ svc_pollfd_add(int fd, struct svc_fdset fds->fdused = fds->fdnum + 1; DPRINTF("add fd=%d slot=%d fdused=%d", fd, fds->fdnum, fds->fdused); fds->fdnum += FD_SETSIZE; + fds->fdp = pfd; return fds; } @@ -323,6 +324,8 @@ svc_fdset_zero(void) DPRINTF("zero"); struct svc_fdset *fds = svc_fdset_alloc(0); + if (fds == NULL) + return; memset(fds->fdset, 0, fds->fdsize); fds->fdmax = -1;
CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Tue Nov 10 18:22:46 UTC 2015 Modified Files: src/sys/net: if_gif.c Log Message: correct mistake in previous To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/net/if_gif.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/net/if_gif.c diff -u src/sys/net/if_gif.c:1.89 src/sys/net/if_gif.c:1.90 --- src/sys/net/if_gif.c:1.89 Tue Nov 10 12:59:37 2015 +++ src/sys/net/if_gif.c Tue Nov 10 13:22:46 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gif.c,v 1.89 2015/11/10 17:59:37 christos Exp $ */ +/* $NetBSD: if_gif.c,v 1.90 2015/11/10 18:22:46 christos Exp $ */ /* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.89 2015/11/10 17:59:37 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.90 2015/11/10 18:22:46 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -669,8 +669,6 @@ gif_set_tunnel(struct ifnet *ifp, struct s = splsoftnet(); - osrc = sc->gif_psrc; - odst = sc->gif_pdst; LIST_FOREACH(sc2, _softc_list, gif_list) { if (sc2 == sc) continue; @@ -706,22 +704,23 @@ gif_set_tunnel(struct ifnet *ifp, struct #endif } + osrc = sc->gif_psrc; + odst = sc->gif_pdst; sc->gif_psrc = sc->gif_pdst = NULL; - sc->gif_si = softint_establish(SOFTINT_NET, gifintr, sc); if (sc->gif_si == NULL) { error = ENOMEM; - goto bad; + goto rollback; } if ((sc->gif_psrc = sockaddr_dup(src, M_WAITOK)) == NULL) { error = ENOMEM; - goto bad; + goto rollback; } if ((sc->gif_pdst = sockaddr_dup(dst, M_WAITOK)) == NULL) { error = ENOMEM; - goto bad; + goto rollback; } switch (sc->gif_psrc->sa_family) { @@ -740,7 +739,7 @@ gif_set_tunnel(struct ifnet *ifp, struct break; } if (error) - goto bad; + goto rollback; if (osrc) sockaddr_free(osrc); @@ -752,15 +751,14 @@ gif_set_tunnel(struct ifnet *ifp, struct return 0; - bad: - /* rollback */ +rollback: if (sc->gif_psrc != NULL) sockaddr_free(sc->gif_psrc); if (sc->gif_pdst != NULL) sockaddr_free(sc->gif_pdst); sc->gif_psrc = osrc; sc->gif_pdst = odst; - +bad: if (sc->gif_si) { softint_disestablish(sc->gif_si); sc->gif_si = NULL;
CVS commit: src/external/bsd/wpa/dist/wpa_supplicant
Module Name:src Committed By: christos Date: Tue Nov 10 18:39:40 UTC 2015 Modified Files: src/external/bsd/wpa/dist/wpa_supplicant: wnm_sta.c Log Message: Apply patch by Jouni Malinen. We don't have CONFIG_EAP_PWD enabled so we are not affected: EAP-pwd peer error path failure on unexpected Confirm message Published: November 10, 2015 Identifier: CVE-2015-5316 Latest version available from: http://w1.fi/security/2015-8/ Vulnerability A vulnerability was found in EAP-pwd peer implementation used in wpa_supplicant. If an EAP-pwd Confirm message is received unexpectedly before the Identity exchange, the error path processing ended up dereferencing a NULL pointer and terminating the process. For wpa_supplicant with EAP-pwd enabled in a network configuration profile, this could allow a denial of service attack by an attacker within radio range. Vulnerable versions/configurations wpa_supplicant v2.3-v2.5 with CONFIG_EAP_PWD=y in the build configuration (wpa_supplicant/.config) and EAP-pwd enabled in a network profile at runtime. Possible mitigation steps - Merge the following commits and rebuild wpa_supplicant: EAP-pwd peer: Fix error path for unexpected Confirm message This patch is available from http://w1.fi/security/2015-8/ - Update to wpa_supplicant v2.6 or newer, once available - Remove CONFIG_EAP_PWD=y from build configuration - Disable EAP-pwd in runtime configuration To generate a diff of this commit: cvs rdiff -u -r1.1.1.3 -r1.2 \ src/external/bsd/wpa/dist/wpa_supplicant/wnm_sta.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/wpa/dist/wpa_supplicant/wnm_sta.c diff -u src/external/bsd/wpa/dist/wpa_supplicant/wnm_sta.c:1.1.1.3 src/external/bsd/wpa/dist/wpa_supplicant/wnm_sta.c:1.2 --- src/external/bsd/wpa/dist/wpa_supplicant/wnm_sta.c:1.1.1.3 Wed Apr 1 15:24:39 2015 +++ src/external/bsd/wpa/dist/wpa_supplicant/wnm_sta.c Tue Nov 10 13:39:40 2015 @@ -187,6 +187,12 @@ static void wnm_sleep_mode_exit_success( end = ptr + key_len_total; wpa_hexdump_key(MSG_DEBUG, "WNM: Key Data", ptr, key_len_total); + if (key_len_total && !wpa_sm_pmf_enabled(wpa_s->wpa)) { + wpa_msg(wpa_s, MSG_INFO, + "WNM: Ignore Key Data in WNM-Sleep Mode Response - PMF not enabled"); + return; + } + while (ptr + 1 < end) { if (ptr + 2 + ptr[1] > end) { wpa_printf(MSG_DEBUG, "WNM: Invalid Key Data element "
CVS commit: src/usr.sbin/rpcbind
Module Name:src Committed By: christos Date: Tue Nov 10 18:04:52 UTC 2015 Modified Files: src/usr.sbin/rpcbind: rpcb_svc_com.c Log Message: CID 1338514: Check NULL returns To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/rpcbind/rpcb_svc_com.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/rpcbind/rpcb_svc_com.c diff -u src/usr.sbin/rpcbind/rpcb_svc_com.c:1.17 src/usr.sbin/rpcbind/rpcb_svc_com.c:1.18 --- src/usr.sbin/rpcbind/rpcb_svc_com.c:1.17 Sun Nov 8 11:36:28 2015 +++ src/usr.sbin/rpcbind/rpcb_svc_com.c Tue Nov 10 13:04:51 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: rpcb_svc_com.c,v 1.17 2015/11/08 16:36:28 christos Exp $ */ +/* $NetBSD: rpcb_svc_com.c,v 1.18 2015/11/10 18:04:51 christos Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -1080,7 +1080,7 @@ my_svc_run(void) struct pollfd *pollfds; int npollfds; int poll_ret, check_ret; - int n, m; + int n, *m; #ifdef SVC_RUN_DEBUG int i; #endif @@ -1095,8 +1095,15 @@ my_svc_run(void) pollfds = realloc(pollfds, npollfds * sizeof(*pollfds)); } p = pollfds; - m = *svc_fdset_getmax(); - for (n = 0; n <= m; n++) { + if (p == NULL) { +out: + syslog(LOG_ERR, "Cannot allocate pollfds"); + sleep(1); + continue; + } + if ((m = svc_fdset_getmax()) == NULL) + goto out; + for (n = 0; n <= *m; n++) { if (svc_fdset_isset(n)) { p->fd = n; p->events = MASKVAL;
CVS commit: src/lib/libc/rpc
Module Name:src Committed By: christos Date: Tue Nov 10 18:01:16 UTC 2015 Modified Files: src/lib/libc/rpc: rpc_soc.c Log Message: CID 1338513: Check listen(2) return To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/lib/libc/rpc/rpc_soc.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/libc/rpc/rpc_soc.c diff -u src/lib/libc/rpc/rpc_soc.c:1.19 src/lib/libc/rpc/rpc_soc.c:1.20 --- src/lib/libc/rpc/rpc_soc.c:1.19 Wed May 28 10:45:57 2014 +++ src/lib/libc/rpc/rpc_soc.c Tue Nov 10 13:01:16 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_soc.c,v 1.19 2014/05/28 14:45:57 christos Exp $ */ +/* $NetBSD: rpc_soc.c,v 1.20 2015/11/10 18:01:16 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -45,7 +45,7 @@ #if 0 static char sccsid[] = "@(#)rpc_soc.c 1.41 89/05/02 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: rpc_soc.c,v 1.19 2014/05/28 14:45:57 christos Exp $"); +__RCSID("$NetBSD: rpc_soc.c,v 1.20 2015/11/10 18:01:16 christos Exp $"); #endif #endif @@ -255,17 +255,20 @@ svc_com_create(int fd, u_int sendsize, u memset(, 0, sizeof sccsin); sccsin.sin_family = AF_INET; (void)bindresvport(fd, ); - listen(fd, SOMAXCONN); + if (listen(fd, SOMAXCONN) == -1) + goto out; svc = svc_tli_create(fd, nconf, NULL, sendsize, recvsize); (void) freenetconfigent(nconf); - if (svc == NULL) { - if (madefd) - (void) close(fd); - return (NULL); + if (svc == NULL) + goto out; } port = (((struct sockaddr_in *)svc->xp_ltaddr.buf)->sin_port); svc->xp_port = ntohs(port); - return (svc); + return svc; +out: + if (madefd) + (void) close(fd); + return NULL; } SVCXPRT *
CVS commit: src/lib/libc/rpc
Module Name:src Committed By: christos Date: Tue Nov 10 18:08:05 UTC 2015 Modified Files: src/lib/libc/rpc: svc_fdset.c Log Message: CID 1338517: Check negative returns To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libc/rpc/svc_fdset.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/libc/rpc/svc_fdset.c diff -u src/lib/libc/rpc/svc_fdset.c:1.12 src/lib/libc/rpc/svc_fdset.c:1.13 --- src/lib/libc/rpc/svc_fdset.c:1.12 Sun Nov 8 14:30:53 2015 +++ src/lib/libc/rpc/svc_fdset.c Tue Nov 10 13:08:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_fdset.c,v 1.12 2015/11/08 19:30:53 christos Exp $ */ +/* $NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: svc_fdset.c,v 1.12 2015/11/08 19:30:53 christos Exp $"); +__RCSID("$NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $"); #include "reentrant.h" @@ -434,6 +434,8 @@ struct pollfd * svc_pollfd_copy(const struct pollfd *orig) { int size = svc_fdset_getsize(0); + if (size == -1) + return NULL; struct pollfd *copy = calloc(size, sizeof(*orig)); if (copy == NULL) return NULL;
CVS commit: src/tests/lib/libc/rpc
Module Name:src Committed By: christos Date: Tue Nov 10 18:13:01 UTC 2015 Modified Files: src/tests/lib/libc/rpc: t_rpc.c Log Message: CID 1338516: Handle svc_run() returning. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/rpc/t_rpc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/rpc/t_rpc.c diff -u src/tests/lib/libc/rpc/t_rpc.c:1.7 src/tests/lib/libc/rpc/t_rpc.c:1.8 --- src/tests/lib/libc/rpc/t_rpc.c:1.7 Sun Nov 8 14:40:06 2015 +++ src/tests/lib/libc/rpc/t_rpc.c Tue Nov 10 13:13:01 2015 @@ -1,7 +1,7 @@ -/* $NetBSD: t_rpc.c,v 1.7 2015/11/08 19:40:06 christos Exp $ */ +/* $NetBSD: t_rpc.c,v 1.8 2015/11/10 18:13:01 christos Exp $ */ #include -__RCSID("$NetBSD: t_rpc.c,v 1.7 2015/11/08 19:40:06 christos Exp $"); +__RCSID("$NetBSD: t_rpc.c,v 1.8 2015/11/10 18:13:01 christos Exp $"); #include #include @@ -182,6 +182,7 @@ regtest(const char *hostname, const char case 0: DPRINTF("Calling svc_run\n"); svc_run(); + ERRX(EXIT_FAILURE, "svc_run returned %d!", num); case -1: ERRX(EXIT_FAILURE, "Fork failed (%s)", strerror(errno)); default:
CVS commit: src/lib/libc/rpc
Module Name:src Committed By: christos Date: Tue Nov 10 20:56:20 UTC 2015 Modified Files: src/lib/libc/rpc: rpc_soc.c svc_fdset.c svc_run.c svc_vc.c Log Message: fix compilation/lint To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libc/rpc/rpc_soc.c cvs rdiff -u -r1.14 -r1.15 src/lib/libc/rpc/svc_fdset.c cvs rdiff -u -r1.26 -r1.27 src/lib/libc/rpc/svc_run.c cvs rdiff -u -r1.33 -r1.34 src/lib/libc/rpc/svc_vc.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/libc/rpc/rpc_soc.c diff -u src/lib/libc/rpc/rpc_soc.c:1.20 src/lib/libc/rpc/rpc_soc.c:1.21 --- src/lib/libc/rpc/rpc_soc.c:1.20 Tue Nov 10 13:01:16 2015 +++ src/lib/libc/rpc/rpc_soc.c Tue Nov 10 15:56:20 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_soc.c,v 1.20 2015/11/10 18:01:16 christos Exp $ */ +/* $NetBSD: rpc_soc.c,v 1.21 2015/11/10 20:56:20 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -45,7 +45,7 @@ #if 0 static char sccsid[] = "@(#)rpc_soc.c 1.41 89/05/02 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: rpc_soc.c,v 1.20 2015/11/10 18:01:16 christos Exp $"); +__RCSID("$NetBSD: rpc_soc.c,v 1.21 2015/11/10 20:56:20 christos Exp $"); #endif #endif @@ -261,7 +261,6 @@ svc_com_create(int fd, u_int sendsize, u (void) freenetconfigent(nconf); if (svc == NULL) goto out; - } port = (((struct sockaddr_in *)svc->xp_ltaddr.buf)->sin_port); svc->xp_port = ntohs(port); return svc; Index: src/lib/libc/rpc/svc_fdset.c diff -u src/lib/libc/rpc/svc_fdset.c:1.14 src/lib/libc/rpc/svc_fdset.c:1.15 --- src/lib/libc/rpc/svc_fdset.c:1.14 Tue Nov 10 13:11:05 2015 +++ src/lib/libc/rpc/svc_fdset.c Tue Nov 10 15:56:20 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $ */ +/* $NetBSD: svc_fdset.c,v 1.15 2015/11/10 20:56:20 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $"); +__RCSID("$NetBSD: svc_fdset.c,v 1.15 2015/11/10 20:56:20 christos Exp $"); #include "reentrant.h" @@ -146,7 +146,7 @@ svc_fdset_sanitize(struct svc_fdset *fds #ifdef _LIBC /* Compat update */ if (fds == &__svc_fdset) { - svc_fdset = *(__fd_set_256 *)__svc_fdset.fdset; + svc_fdset = *(__fd_set_256 *)(void *)__svc_fdset.fdset; svc_maxfd = __svc_fdset.fdmax; } #endif Index: src/lib/libc/rpc/svc_run.c diff -u src/lib/libc/rpc/svc_run.c:1.26 src/lib/libc/rpc/svc_run.c:1.27 --- src/lib/libc/rpc/svc_run.c:1.26 Tue Nov 10 13:06:53 2015 +++ src/lib/libc/rpc/svc_run.c Tue Nov 10 15:56:20 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_run.c,v 1.26 2015/11/10 18:06:53 christos Exp $ */ +/* $NetBSD: svc_run.c,v 1.27 2015/11/10 20:56:20 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)svc_run.c 2.1 88/07/29 4.0 RPCSRC"; #else -__RCSID("$NetBSD: svc_run.c,v 1.26 2015/11/10 18:06:53 christos Exp $"); +__RCSID("$NetBSD: svc_run.c,v 1.27 2015/11/10 20:56:20 christos Exp $"); #endif #endif @@ -156,7 +156,7 @@ svc_run_poll(void) goto out; } - if (pdf == NULL || fdsize != svc_pollfd_getsize(0)) { + if (pfd == NULL || fdsize != svc_pollfd_getsize(0)) { fdsize = svc_fdset_getsize(0); free(pfd); pfd = svc_pollfd_copy(svc_pollfd_get()); @@ -169,7 +169,7 @@ svc_run_poll(void) rwlock_unlock(_fd_lock); - switch ((i = poll(pfd, *maxfd, 30 * 1000))) { + switch ((i = poll(pfd, (size_t)*maxfd, 30 * 1000))) { case -1: #ifndef RUMP_RPC if ((errno == EINTR || errno == EBADF) && probs < 100) { Index: src/lib/libc/rpc/svc_vc.c diff -u src/lib/libc/rpc/svc_vc.c:1.33 src/lib/libc/rpc/svc_vc.c:1.34 --- src/lib/libc/rpc/svc_vc.c:1.33 Sat Nov 7 18:09:20 2015 +++ src/lib/libc/rpc/svc_vc.c Tue Nov 10 15:56:20 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_vc.c,v 1.33 2015/11/07 23:09:20 christos Exp $ */ +/* $NetBSD: svc_vc.c,v 1.34 2015/11/10 20:56:20 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC"; #else -__RCSID("$NetBSD: svc_vc.c,v 1.33 2015/11/07 23:09:20 christos Exp $"); +__RCSID("$NetBSD: svc_vc.c,v 1.34 2015/11/10 20:56:20 christos Exp $"); #endif #endif @@ -756,6 +756,7 @@ svc_vc_rendezvous_ops(SVCXPRT *xprt) * cleaned. If timeout is 0, the least active connection is picked. */ bool_t +/*ARGSUSED1*/ __svc_clean_idle(fd_set *fds __unused, int timeout, bool_t cleanblock) { int i, ncleaned, *fdmax;
CVS commit: src/sys/arch/evbarm/odroid
Module Name:src Committed By: marty Date: Tue Nov 10 23:47:08 UTC 2015 Modified Files: src/sys/arch/evbarm/odroid: odroid_start.S Log Message: small cleanup of odroid_start.S removed attempt to 'rescue bootargs' that was causing a hang and isn't needed anyway. changed calls to XPUTC to use text constants rather than ascii decimal equivalents. adopted some of the techniques used in awin_start.s for reducing code and improving performance. polluted the namespace with _XPUTC so that xputc can be used from C code before early console is enabled. (Due to tracking a bug in early console initialization.) replaced a hardwired constant with the proper mannifest in the definition of TEMP_L1_TABLE This still needs MP support added but it should continue to work for XU3 while starting to work for XU4 To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/odroid/odroid_start.S 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/evbarm/odroid/odroid_start.S diff -u src/sys/arch/evbarm/odroid/odroid_start.S:1.6 src/sys/arch/evbarm/odroid/odroid_start.S:1.7 --- src/sys/arch/evbarm/odroid/odroid_start.S:1.6 Thu Oct 2 12:12:55 2014 +++ src/sys/arch/evbarm/odroid/odroid_start.S Tue Nov 10 23:47:08 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: odroid_start.S,v 1.6 2014/10/02 12:12:55 skrll Exp $ */ +/* $NetBSD: odroid_start.S,v 1.7 2015/11/10 23:47:08 marty Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -46,13 +46,16 @@ #include -RCSID("$NetBSD: odroid_start.S,v 1.6 2014/10/02 12:12:55 skrll Exp $") +RCSID("$NetBSD: odroid_start.S,v 1.7 2015/11/10 23:47:08 marty Exp $") #if defined(VERBOSE_INIT_ARM) - #define XPUTC(n) mov r0, n; bl xputc +#if KERNEL_BASE_VOFFSET == 0 +#define XPUTC2(n) mov r0, n; bl xputc +#else #define XPUTC2(n) mov r0, n; blx r11 +#endif #ifdef __ARMEB__ #define COM_BSWAP #endif @@ -62,8 +65,7 @@ RCSID("$NetBSD: odroid_start.S,v 1.6 201 #endif #define INIT_MEMSIZE 128 - -#define TEMP_L1_TABLE (KERNEL_BASE - KERNEL_BASE_VOFFSET + INIT_MEMSIZE * 0x10 - L1_TABLE_SIZE) +#define TEMP_L1_TABLE (KERNEL_BASE - KERNEL_BASE_VOFFSET + INIT_MEMSIZE * L1_S_SIZE - L1_TABLE_SIZE) #define MD_CPU_HATCH _C_LABEL(exynos_cpu_hatch) @@ -72,8 +74,12 @@ RCSID("$NetBSD: odroid_start.S,v 1.6 201 * At this point, this code has been loaded into SDRAM * and the MMU is off */ +#ifdef KERNEL_BASES_EQUAL + .text +#else .section .start,"ax",%progbits - +#endif + .global _C_LABEL(odroid_start) _C_LABEL(odroid_start): #ifdef __ARMEB__ @@ -91,75 +97,16 @@ _C_LABEL(odroid_start): */ movw r4, #:lower16:uboot_args movt r4, #:upper16:uboot_args +#if KERNEL_BASE_VOFFSET != 0 sub r4, r4, #KERNEL_BASE_VOFFSET +#endif stmia r4, {r0-r3} // Save the arguments /* - * Rescue passed "bootargs" env variable. This is not trivial - * since we can be booted using either `go' or trough `bootm'. - * - * 'go' passes R0 = argc, R1 = argv - * 'bootm' passes R0 = uboot_bootinfo, R3 = bootargs - */ - - movw r4, #:lower16:bootargs - movt r4, #:upper16:bootargs - sub r4, r4, #KERNEL_BASE_VOFFSET - - cmp r0, #0 - beq 1f - cmp r0, #MAX_BOOT_STRING - bge 1f - - /* `go' method */ - cmp r0, #1 // extra argument? - beq 3f - ldr r5, [r1, #4]// load argv[1] -2: - ldrb r0, [r5], #1 - strb r0, [r4], #1 - teq r0, #0 - bne 2b - - b 3f -1: - /* `bootm' method */ - mov r6, r0 // save binfo pointer - - cmp r3, #0 - beq 1f -2: - ldrb r0, [r3], #1 - strb r0, [r4], #1 - teq r0, #0 - bne 2b - -1: - cmp r6, #0 // binfo passed? - beq 3f - - add r6, r6, #0x250// to eth addr - - movw r4, #:lower16:uboot_enaddr - movt r4, #:upper16:uboot_enaddr - mov r2, #6 -2: - ldrb r0, [r6], #1 - strb r0, [r4], #1 - subs r2, r2, #1 - bne 2b - -3: - - /* * For easy and early SoC / PoP dependency, retrieve the IDs */ -#if 1 - mov r6, #EXYNOS_CORE_PBASE -#else movw r6, #:lower16:EXYNOS_CORE_PBASE movt r6, #:upper16:EXYNOS_CORE_PBASE -#endif ldr r0, [r6, #EXYNOS_PROD_ID_OFFSET] // load soc_id @@ -205,49 +152,53 @@ _C_LABEL(odroid_start): */ bl cortex_init - XPUTC(#67) + XPUTC(#'C') /* * Set up a preliminary mapping in the MMU to allow us to run * at KERNEL_BASE with caches on. */ - adr r1, .Lmmu_init_table movw r0, #:lower16:TEMP_L1_TABLE movt r0, #:upper16:TEMP_L1_TABLE + movw r1, #:lower16:.Lmmu_init_table + movt r1, #:upper16:.Lmmu_init_table bl arm_boot_l1pt_init - XPUTC(#68) + XPUTC(#'D') /* * Turn on the MMU, Caches, etc. */ -#ifdef VERBOSE_INIT_ARM - adr r11, xputc + movw r0, #:lower16:TEMP_L1_TABLE + movt r0, #:upper16:TEMP_L1_TABLE +#if KERNEL_BASE_VOFFSET == 0 + bl arm_cpuinit +#else +#if defined(VERBOSE_INIT_ARM) + adr r11, xputc @ for XPUTC2 #endif movw lr, #:lower16:1f movt lr, #:upper16:1f - movw r0, #:lower16:TEMP_L1_TABLE - movt r0, #:upper16:TEMP_L1_TABLE b arm_cpuinit - -
CVS commit: src/sys/arch/arm/nvidia
Module Name:src Committed By: jmcneill Date: Tue Nov 10 22:14:05 UTC 2015 Modified Files: src/sys/arch/arm/nvidia: tegra_dcreg.h tegra_drm.c tegra_drm.h tegra_drm_mode.c Log Message: Add vblank support To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_dcreg.h \ src/sys/arch/arm/nvidia/tegra_drm_mode.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nvidia/tegra_drm.c \ src/sys/arch/arm/nvidia/tegra_drm.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/arm/nvidia/tegra_dcreg.h diff -u src/sys/arch/arm/nvidia/tegra_dcreg.h:1.3 src/sys/arch/arm/nvidia/tegra_dcreg.h:1.4 --- src/sys/arch/arm/nvidia/tegra_dcreg.h:1.3 Thu Jul 23 15:08:19 2015 +++ src/sys/arch/arm/nvidia/tegra_dcreg.h Tue Nov 10 22:14:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_dcreg.h,v 1.3 2015/07/23 15:08:19 skrll Exp $ */ +/* $NetBSD: tegra_dcreg.h,v 1.4 2015/11/10 22:14:05 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill@@ -73,6 +73,8 @@ #define DC_CMD_INT_STATUS_REG0x0dc #define DC_CMD_INT_MASK_REG0x0e0 #define DC_CMD_INT_ENABLE_REG0x0e4 +#define DC_CMD_INT_V_BLANK__BIT(2) + #define DC_CMD_INT_TYPE_REG0x0e8 #define DC_CMD_INT_POLARITY_REG0x0ec #define DC_CMD_SIGNAL_RAISE1_REG 0x0f0 Index: src/sys/arch/arm/nvidia/tegra_drm_mode.c diff -u src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.3 src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.4 --- src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.3 Tue Nov 10 00:33:39 2015 +++ src/sys/arch/arm/nvidia/tegra_drm_mode.c Tue Nov 10 22:14:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_drm_mode.c,v 1.3 2015/11/10 00:33:39 jmcneill Exp $ */ +/* $NetBSD: tegra_drm_mode.c,v 1.4 2015/11/10 22:14:05 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_drm_mode.c,v 1.3 2015/11/10 00:33:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_drm_mode.c,v 1.4 2015/11/10 22:14:05 jmcneill Exp $"); #include #include @@ -58,6 +58,7 @@ static const struct drm_framebuffer_func static int tegra_crtc_init(struct drm_device *, int); static void tegra_crtc_destroy(struct drm_crtc *); +static int tegra_crtc_intr(void *); static const struct drm_crtc_funcs tegra_crtc_funcs = { .set_config = drm_crtc_helper_set_config, @@ -187,6 +188,10 @@ tegra_drm_mode_init(struct drm_device *d if (error) return error; + error = drm_vblank_init(ddev, 2); + if (error) + return error; + return 0; } @@ -275,9 +280,16 @@ tegra_crtc_init(struct drm_device *ddev, } crtc->size = size; crtc->intr = intr; + crtc->ih = intr_establish(intr, IPL_VM, IST_LEVEL | IST_MPSAFE, + tegra_crtc_intr, crtc); + if (crtc->ih == NULL) { + DRM_ERROR("failed to establish interrupt for crtc %d\n", index); + } tegra_car_dc_enable(crtc->index); + DC_WRITE(crtc, DC_CMD_INT_ENABLE_REG, DC_CMD_INT_V_BLANK); + drm_crtc_init(ddev, >base, _crtc_funcs); drm_crtc_helper_add(>base, _crtc_helper_funcs); @@ -289,6 +301,9 @@ tegra_crtc_destroy(struct drm_crtc *crtc { struct tegra_crtc *tegra_crtc = to_tegra_crtc(crtc); drm_crtc_cleanup(crtc); + if (tegra_crtc->ih) { + intr_disestablish(tegra_crtc->ih); + } bus_space_unmap(tegra_crtc->bst, tegra_crtc->bsh, tegra_crtc->size); kmem_free(tegra_crtc, sizeof(*tegra_crtc)); } @@ -969,3 +984,73 @@ tegra_connector_best_encoder(struct drm_ return encoder; } + +static int +tegra_crtc_intr(void *priv) +{ + struct tegra_crtc *tegra_crtc = priv; + struct drm_device *ddev = tegra_crtc->base.dev; + struct tegra_drm_softc * const sc = tegra_drm_private(ddev); + int rv = 0; + + const uint32_t status = DC_READ(tegra_crtc, DC_CMD_INT_STATUS_REG); + + if (status & DC_CMD_INT_V_BLANK) { + DC_WRITE(tegra_crtc, DC_CMD_INT_STATUS_REG, DC_CMD_INT_V_BLANK); + atomic_inc_32(>sc_vbl_received[tegra_crtc->index]); + drm_handle_vblank(ddev, tegra_crtc->index); + rv = 1; + } + + return rv; +} + +u32 +tegra_drm_get_vblank_counter(struct drm_device *ddev, int crtc) +{ + struct tegra_drm_softc * const sc = tegra_drm_private(ddev); + + if (crtc > 1) + return 0; + + return sc->sc_vbl_received[crtc]; +} + +int +tegra_drm_enable_vblank(struct drm_device *ddev, int crtc) +{ + struct tegra_crtc *tegra_crtc = NULL; + struct drm_crtc *iter; + + list_for_each_entry(iter, >mode_config.crtc_list, head) { + if (to_tegra_crtc(iter)->index == crtc) { + tegra_crtc = to_tegra_crtc(iter); + break; + } + } + if (tegra_crtc == NULL) + return -EINVAL; + + DC_SET_CLEAR(tegra_crtc, DC_CMD_INT_MASK_REG, DC_CMD_INT_V_BLANK, 0); + + return 0; +} + +void +tegra_drm_disable_vblank(struct drm_device *ddev, int crtc) +{ + struct tegra_crtc *tegra_crtc = NULL; + struct drm_crtc *iter; + + list_for_each_entry(iter, >mode_config.crtc_list, head) { + if (to_tegra_crtc(iter)->index ==
CVS commit: xsrc/external/mit/ctwm/dist
Module Name:xsrc Committed By: jmcneill Date: Tue Nov 10 23:56:43 UTC 2015 Modified Files: xsrc/external/mit/ctwm/dist: util.c Log Message: if CTWM_WELCOME_FILE is defined, try that before falling back to welcome.xwd and .xpm To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/ctwm/dist/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/ctwm/dist/util.c diff -u xsrc/external/mit/ctwm/dist/util.c:1.3 xsrc/external/mit/ctwm/dist/util.c:1.4 --- xsrc/external/mit/ctwm/dist/util.c:1.3 Sat Sep 5 14:29:39 2015 +++ xsrc/external/mit/ctwm/dist/util.c Tue Nov 10 23:56:43 2015 @@ -908,6 +908,10 @@ void MaskScreen (char *file) reportfilenotfound = 0; AlternateCmap = Scr->WelcomeCmap; if (! file) { +#ifdef CTWM_WELCOME_FILE + Scr->WelcomeImage = GetImage (CTWM_WELCOME_FILE, WelcomeCp); + if (Scr->WelcomeImage == None) +#endif Scr->WelcomeImage = GetImage ("xwd:welcome.xwd", WelcomeCp); #ifdef XPM if (Scr->WelcomeImage == None)
CVS commit: src/external/mit/ctwm/bin/ctwm
Module Name:src Committed By: jmcneill Date: Tue Nov 10 23:57:00 UTC 2015 Modified Files: src/external/mit/ctwm/bin/ctwm: Makefile Log Message: use NetBSD-inv.xpm for CTWM_WELCOME_FILE To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/mit/ctwm/bin/ctwm/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/ctwm/bin/ctwm/Makefile diff -u src/external/mit/ctwm/bin/ctwm/Makefile:1.2 src/external/mit/ctwm/bin/ctwm/Makefile:1.3 --- src/external/mit/ctwm/bin/ctwm/Makefile:1.2 Tue Nov 10 23:09:13 2015 +++ src/external/mit/ctwm/bin/ctwm/Makefile Tue Nov 10 23:57:00 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2015/11/10 23:09:13 jmcneill Exp $ +# $NetBSD: Makefile,v 1.3 2015/11/10 23:57:00 jmcneill Exp $ .include @@ -19,6 +19,7 @@ CPPFLAGS+= -I. -I${CTWMDIR}/src \ -DNO_ALLOCA -DCSRG_BASED -DUSEM4 -DGNOME -DXPM CPPFLAGS+= -DPIXMAP_DIRECTORY=\"${XPMDIR}\" +CPPFLAGS+= -DCTWM_WELCOME_FILE=\"xpm:${X11INCDIR}/X11/pixmaps/NetBSD-inv.xpm\" CPPFLAGS.parse.c= -DSYSTEM_INIT_FILE=\"${CTWMCONFIGDIR}/system.twmrc\" \ -DM4CMD=\"m4\"
CVS commit: src/external/mit/ctwm/bin/ctwm
Module Name:src Committed By: jmcneill Date: Tue Nov 10 23:09:13 UTC 2015 Modified Files: src/external/mit/ctwm/bin/ctwm: Makefile Log Message: fix default pixmap search directory To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/mit/ctwm/bin/ctwm/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/ctwm/bin/ctwm/Makefile diff -u src/external/mit/ctwm/bin/ctwm/Makefile:1.1 src/external/mit/ctwm/bin/ctwm/Makefile:1.2 --- src/external/mit/ctwm/bin/ctwm/Makefile:1.1 Thu Sep 3 22:24:02 2015 +++ src/external/mit/ctwm/bin/ctwm/Makefile Tue Nov 10 23:09:13 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2015/09/03 22:24:02 youri Exp $ +# $NetBSD: Makefile,v 1.2 2015/11/10 23:09:13 jmcneill Exp $ .include @@ -16,11 +16,12 @@ CTWMDIR= ${X11SRCDIR}/external/mit/ctwm XPMDIR= ${X11INCDIR}/X11/pixmaps/ctwm CPPFLAGS+= -I. -I${CTWMDIR}/src \ - -DNO_ALLOCA -DCSRG_BASED -DUSEM4 -DGNOME -DXPM \ + -DNO_ALLOCA -DCSRG_BASED -DUSEM4 -DGNOME -DXPM + +CPPFLAGS+= -DPIXMAP_DIRECTORY=\"${XPMDIR}\" CPPFLAGS.parse.c= -DSYSTEM_INIT_FILE=\"${CTWMCONFIGDIR}/system.twmrc\" \ - -DM4CMD=\"m4\" \ - -DPIXMAP_DIRECTORY=\"${XPMDIR}\" + -DM4CMD=\"m4\" FILESDIR= ${XPMDIR}
CVS commit: [nick-nhusb] src/sys/dev/usb
Module Name:src Committed By: skrll Date: Tue Nov 10 08:44:10 UTC 2015 Modified Files: src/sys/dev/usb [nick-nhusb]: uhci.c uhcivar.h Log Message: Restructure the xfer methods so that (close to) minimal work in done in softint context. Now all memory allocation is done in thread context. Addresses kern/48308 for uhci(4), fixes a bunch of locking bugs around the *TD free lists, and plugs some memory leaks on error conditions. To generate a diff of this commit: cvs rdiff -u -r1.264.4.54 -r1.264.4.55 src/sys/dev/usb/uhci.c cvs rdiff -u -r1.52.14.15 -r1.52.14.16 src/sys/dev/usb/uhcivar.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/dev/usb/uhci.c diff -u src/sys/dev/usb/uhci.c:1.264.4.54 src/sys/dev/usb/uhci.c:1.264.4.55 --- src/sys/dev/usb/uhci.c:1.264.4.54 Mon Nov 9 08:35:23 2015 +++ src/sys/dev/usb/uhci.c Tue Nov 10 08:44:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.264.4.54 2015/11/09 08:35:23 skrll Exp $ */ +/* $NetBSD: uhci.c,v 1.264.4.55 2015/11/10 08:44:09 skrll Exp $ */ /* * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.54 2015/11/09 08:35:23 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.55 2015/11/10 08:44:09 skrll Exp $"); #include "opt_usb.h" @@ -139,20 +139,17 @@ struct uhci_pipe { struct { uhci_soft_qh_t *sqh; usb_dma_t reqdma; - uhci_soft_td_t *setup, *stat; - u_int length; + uhci_soft_td_t *setup; + uhci_soft_td_t *stat; } ctrl; /* Interrupt pipe */ struct { int npoll; - int isread; uhci_soft_qh_t **qhs; } intr; /* Bulk pipe */ struct { uhci_soft_qh_t *sqh; - u_int length; - int isread; } bulk; /* Isochronous pipe */ struct isoc { @@ -168,6 +165,7 @@ Static void uhci_reset(uhci_softc_t *); Static usbd_status uhci_run(uhci_softc_t *, int, int); Static uhci_soft_td_t *uhci_alloc_std(uhci_softc_t *); Static void uhci_free_std(uhci_softc_t *, uhci_soft_td_t *); +Static void uhci_free_std_locked(uhci_softc_t *, uhci_soft_td_t *); Static uhci_soft_qh_t *uhci_alloc_sqh(uhci_softc_t *); Static void uhci_free_sqh(uhci_softc_t *, uhci_soft_qh_t *); #if 0 @@ -176,11 +174,15 @@ Static void uhci_enter_ctl_q(uhci_softc Static void uhci_exit_ctl_q(uhci_softc_t *, uhci_soft_qh_t *); #endif -Static void uhci_free_std_chain(uhci_softc_t *, - uhci_soft_td_t *, uhci_soft_td_t *); -Static usbd_status uhci_alloc_std_chain(struct uhci_pipe *, - uhci_softc_t *, int, int, uint16_t, usb_dma_t *, - uhci_soft_td_t **, uhci_soft_td_t **); +Static void uhci_free_std_chain(uhci_softc_t *, uhci_soft_td_t *, + uhci_soft_td_t *); +Static usbd_status uhci_alloc_std_chain(uhci_softc_t *, struct usbd_xfer *, + int, int, uhci_soft_td_t **, uhci_soft_td_t **); +Static void uhci_free_stds(uhci_softc_t *, struct uhci_xfer *); + +Static void uhci_reset_std_chain(uhci_softc_t *, struct usbd_xfer *, + int, int, int *, uhci_soft_td_t *, uhci_soft_td_t **); + Static void uhci_poll_hub(void *); Static void uhci_waitintr(uhci_softc_t *, struct usbd_xfer *); Static void uhci_check_intr(uhci_softc_t *, struct uhci_xfer *); @@ -209,24 +211,32 @@ Static void uhci_get_lock(struct usbd_b Static int uhci_roothub_ctrl(struct usbd_bus *, usb_device_request_t *, void *, int); +Static int uhci_device_ctrl_init(struct usbd_xfer *); +Static void uhci_device_ctrl_fini(struct usbd_xfer *); Static usbd_status uhci_device_ctrl_transfer(struct usbd_xfer *); Static usbd_status uhci_device_ctrl_start(struct usbd_xfer *); Static void uhci_device_ctrl_abort(struct usbd_xfer *); Static void uhci_device_ctrl_close(struct usbd_pipe *); Static void uhci_device_ctrl_done(struct usbd_xfer *); +Static int uhci_device_intr_init(struct usbd_xfer *); +Static void uhci_device_intr_fini(struct usbd_xfer *); Static usbd_status uhci_device_intr_transfer(struct usbd_xfer *); Static usbd_status uhci_device_intr_start(struct usbd_xfer *); Static void uhci_device_intr_abort(struct usbd_xfer *); Static void uhci_device_intr_close(struct usbd_pipe *); Static void uhci_device_intr_done(struct usbd_xfer *); +Static int uhci_device_bulk_init(struct usbd_xfer *); +Static void uhci_device_bulk_fini(struct usbd_xfer *); Static usbd_status uhci_device_bulk_transfer(struct usbd_xfer *); Static usbd_status uhci_device_bulk_start(struct usbd_xfer *); Static void uhci_device_bulk_abort(struct usbd_xfer *); Static void uhci_device_bulk_close(struct usbd_pipe *); Static void uhci_device_bulk_done(struct usbd_xfer *); +Static int uhci_device_isoc_init(struct usbd_xfer *); +Static void uhci_device_isoc_fini(struct usbd_xfer *); Static usbd_status uhci_device_isoc_transfer(struct usbd_xfer *); Static usbd_status uhci_device_isoc_start(struct usbd_xfer *); Static
CVS commit: src/sys/arch/amd64/conf
Module Name:src Committed By: tnn Date: Tue Nov 10 13:01:41 UTC 2015 Modified Files: src/sys/arch/amd64/conf: ALL XEN3_DOM0 XEN3_DOMU Log Message: Add "pseudo-device iscsi" to ALL and as a commented out hint in XEN3_* To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amd64/conf/ALL cvs rdiff -u -r1.115 -r1.116 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.63 -r1.64 src/sys/arch/amd64/conf/XEN3_DOMU 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/amd64/conf/ALL diff -u src/sys/arch/amd64/conf/ALL:1.32 src/sys/arch/amd64/conf/ALL:1.33 --- src/sys/arch/amd64/conf/ALL:1.32 Sun Oct 25 22:48:23 2015 +++ src/sys/arch/amd64/conf/ALL Tue Nov 10 13:01:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.32 2015/10/25 22:48:23 khorben Exp $ +# $NetBSD: ALL,v 1.33 2015/11/10 13:01:41 tnn Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.32 $" +#ident "ALL-$Revision: 1.33 $" maxusers 64 # estimated number of users @@ -1587,6 +1587,9 @@ pseudo-device vcoda # coda minicache < # a pseudo device needed for SMBFS pseudo-device nsmb # experimental - SMB requester +# iSCSI initiator +pseudo-device iscsi + # wscons pseudo-devices pseudo-device wsmux # mouse & keyboard multiplexor pseudo-device wsfont Index: src/sys/arch/amd64/conf/XEN3_DOM0 diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.115 src/sys/arch/amd64/conf/XEN3_DOM0:1.116 --- src/sys/arch/amd64/conf/XEN3_DOM0:1.115 Sat Aug 8 06:36:24 2015 +++ src/sys/arch/amd64/conf/XEN3_DOM0 Tue Nov 10 13:01:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.115 2015/08/08 06:36:24 maxv Exp $ +# $NetBSD: XEN3_DOM0,v 1.116 2015/11/10 13:01:41 tnn Exp $ include "arch/amd64/conf/std.xen" @@ -835,6 +835,9 @@ pseudo-device vcoda # coda minicache < # a pseudo device needed for SMBFS pseudo-device nsmb # experimental - SMB requester +# iSCSI initiator +#pseudo-device iscsi + # wscons pseudo-devices pseudo-device wsmux # mouse & keyboard multiplexor pseudo-device wsfont Index: src/sys/arch/amd64/conf/XEN3_DOMU diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.63 src/sys/arch/amd64/conf/XEN3_DOMU:1.64 --- src/sys/arch/amd64/conf/XEN3_DOMU:1.63 Wed Aug 12 07:53:57 2015 +++ src/sys/arch/amd64/conf/XEN3_DOMU Tue Nov 10 13:01:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOMU,v 1.63 2015/08/12 07:53:57 maxv Exp $ +# $NetBSD: XEN3_DOMU,v 1.64 2015/11/10 13:01:41 tnn Exp $ include "arch/amd64/conf/std.xen" @@ -245,6 +245,11 @@ pseudo-device vcoda # coda minicache < # a pseudo device needed for SMBFS pseudo-device nsmb # experimental - SMB requester +# iSCSI initiator and dependencies +#scsibus* at scsi? +#sd* at scsibus? target ? lun ? +#pseudo-device iscsi + # userland interface to drivers, including autoconf and properties retrieval pseudo-device drvctl
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jakllsch Date: Wed Nov 11 02:43:09 UTC 2015 Modified Files: src/sys/dev/ic: ahcisata_core.c Log Message: Only sync and unload dma map in ahci_atapi_complete() if appropriate. Fixes ahcisata atapi cd(4) on arm (specifically, JETSONTK1), which insists that a zero-length dmamap can not be synced. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/dev/ic/ahcisata_core.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/ic/ahcisata_core.c diff -u src/sys/dev/ic/ahcisata_core.c:1.54 src/sys/dev/ic/ahcisata_core.c:1.55 --- src/sys/dev/ic/ahcisata_core.c:1.54 Sun May 24 22:30:05 2015 +++ src/sys/dev/ic/ahcisata_core.c Wed Nov 11 02:43:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_core.c,v 1.54 2015/05/24 22:30:05 jmcneill Exp $ */ +/* $NetBSD: ahcisata_core.c,v 1.55 2015/11/11 02:43:09 jakllsch Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.54 2015/05/24 22:30:05 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.55 2015/11/11 02:43:09 jakllsch Exp $"); #include #include @@ -1714,11 +1714,13 @@ ahci_atapi_complete(struct ata_channel * } chp->ch_queue->active_xfer = NULL; - bus_dmamap_sync(sc->sc_dmat, achp->ahcic_datad[slot], 0, - achp->ahcic_datad[slot]->dm_mapsize, - (sc_xfer->xs_control & XS_CTL_DATA_IN) ? BUS_DMASYNC_POSTREAD : - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[slot]); + if (xfer->c_bcount > 0) { + bus_dmamap_sync(sc->sc_dmat, achp->ahcic_datad[slot], 0, + achp->ahcic_datad[slot]->dm_mapsize, + (sc_xfer->xs_control & XS_CTL_DATA_IN) ? + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[slot]); + } if (chp->ch_drive[drive].drive_flags & ATA_DRIVE_WAITDRAIN) { ahci_atapi_kill_xfer(chp, xfer, KILL_GONE);
CVS commit: src
Module Name:src Committed By: ozaki-r Date: Wed Nov 11 07:48:41 UTC 2015 Modified Files: src/distrib/sets/lists/base: mi src/distrib/sets/lists/debug: mi src/usr.sbin/rtadvd: Makefile advcap.c config.c dump.c if.c rrenum.c rtadvd.c timer.c Log Message: Introduce rump.rtadvd It is used to write ATF tests for RA. >From s-yamaguchi@IIJ. To generate a diff of this commit: cvs rdiff -u -r1.1116 -r1.1117 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.133 -r1.134 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/rtadvd/Makefile cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/rtadvd/advcap.c cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/rtadvd/config.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/rtadvd/dump.c \ src/usr.sbin/rtadvd/timer.c cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/rtadvd/if.c cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/rtadvd/rrenum.c cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/rtadvd/rtadvd.c 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.1116 src/distrib/sets/lists/base/mi:1.1117 --- src/distrib/sets/lists/base/mi:1.1116 Sun Nov 8 20:00:22 2015 +++ src/distrib/sets/lists/base/mi Wed Nov 11 07:48:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1116 2015/11/08 20:00:22 christos Exp $ +# $NetBSD: mi,v 1.1117 2015/11/11 07:48:41 ozaki-r Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -1828,6 +1828,7 @@ ./usr/sbin/rpc.yppasswdd base-nis-bin yp ./usr/sbin/rpcbindbase-rpcbind-bin ./usr/sbin/rtadvdbase-router-bin use_inet6 +./usr/sbin/rump.rtadvdbase-router-bin use_inet6,rump ./usr/sbin/rtquerybase-netutil-bin ./usr/sbin/rtsoldbase-obsolete obsolete ./usr/sbin/rump.arpbase-netutil-bin rump Index: src/distrib/sets/lists/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.133 src/distrib/sets/lists/debug/mi:1.134 --- src/distrib/sets/lists/debug/mi:1.133 Sun Nov 8 20:00:22 2015 +++ src/distrib/sets/lists/debug/mi Wed Nov 11 07:48:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.133 2015/11/08 20:00:22 christos Exp $ +# $NetBSD: mi,v 1.134 2015/11/11 07:48:41 ozaki-r Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -1199,6 +1199,7 @@ ./usr/libdata/debug/usr/sbin/rpc.yppasswdd.debug comp-nis-debug yp,debug ./usr/libdata/debug/usr/sbin/rpcbind.debug comp-rpcbind-debug debug ./usr/libdata/debug/usr/sbin/rtadvd.debug comp-router-debug use_inet6,debug +./usr/libdata/debug/usr/sbin/rump.rtadvd.debug comp-router-debug use_inet6,debug,rump ./usr/libdata/debug/usr/sbin/rtquery.debug comp-netutil-debug debug ./usr/libdata/debug/usr/sbin/rtsold.debug comp-obsolete obsolete ./usr/libdata/debug/usr/sbin/rump.arp.debug comp-netutil-debug debug,rump Index: src/usr.sbin/rtadvd/Makefile diff -u src/usr.sbin/rtadvd/Makefile:1.17 src/usr.sbin/rtadvd/Makefile:1.18 --- src/usr.sbin/rtadvd/Makefile:1.17 Fri Aug 10 12:10:30 2012 +++ src/usr.sbin/rtadvd/Makefile Wed Nov 11 07:48:41 2015 @@ -1,24 +1,31 @@ -# $NetBSD: Makefile,v 1.17 2012/08/10 12:10:30 joerg Exp $ +# $NetBSD: Makefile,v 1.18 2015/11/11 07:48:41 ozaki-r Exp $ WARNS?= 4 .include -USE_FORT?= yes # network server +USE_FORT?= yes # network server -PROG= rtadvd -SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c dump.c - -CPPFLAGS+=-DINET6 -MAN= rtadvd.8 rtadvd.conf.5 -LDADD+= -lutil -DPADD+= ${LIBUTIL} +RUMPPRG= rtadvd +SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c dump.c +MAN= rtadvd.8 rtadvd.conf.5 + +CPPFLAGS+= -DINET6 +LDADD+= -lutil +DPADD+= ${LIBUTIL} .if ${MKSHARE} != "no" FILESDIR= /usr/share/examples/rtadvd FILES= rtadvd.conf .endif +.PATH: ${.CURDIR}/../../lib/libc/net +RUMPSRCS= getifaddrs.c getnameinfo.c if_indextoname.c if_nametoindex.c +.if (${MKRUMP} != "no") +CPPFLAGS+= -DRUMP_ACTION +.endif + + .include .if defined(HAVE_GCC) || defined(HAVE_LLVM) Index: src/usr.sbin/rtadvd/advcap.c diff -u src/usr.sbin/rtadvd/advcap.c:1.15 src/usr.sbin/rtadvd/advcap.c:1.16 --- src/usr.sbin/rtadvd/advcap.c:1.15 Fri Jun 5 15:41:59 2015 +++ src/usr.sbin/rtadvd/advcap.c Wed Nov 11 07:48:41 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: advcap.c,v 1.15 2015/06/05 15:41:59 roy Exp $ */ +/* $NetBSD: advcap.c,v 1.16 2015/11/11 07:48:41 ozaki-r Exp $ */ /* $KAME: advcap.c,v 1.11 2003/05/19 09:46:50 keiichi Exp $ */ /* @@ -46,6 +46,7 @@ #include #include #include "pathnames.h" +#include "prog_ops.h" #ifndef __UNCONST #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) @@ -159,7 +160,7 @@ getent(char *bp, char *name, char *cp) break; } if (cp >= bp + BUFSIZ) { -write(2,"Remcap entry too long\n", 23); +prog_write(2,"Remcap entry too long\n", 23);
CVS commit: src/sys/arch/evbarm/odroid
Module Name:src Committed By: marty Date: Wed Nov 11 00:58:21 UTC 2015 Modified Files: src/sys/arch/evbarm/odroid: platform.h Log Message: Fix typo that prevented CONADDR from being defined for XU4 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/odroid/platform.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/evbarm/odroid/platform.h diff -u src/sys/arch/evbarm/odroid/platform.h:1.2 src/sys/arch/evbarm/odroid/platform.h:1.3 --- src/sys/arch/evbarm/odroid/platform.h:1.2 Sun Jun 15 20:14:41 2014 +++ src/sys/arch/evbarm/odroid/platform.h Wed Nov 11 00:58:21 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: platform.h,v 1.2 2014/06/15 20:14:41 matt Exp $ */ +/* $NetBSD: platform.h,v 1.3 2015/11/11 00:58:21 marty Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -51,7 +51,7 @@ */ #define CONADDR_VA ((CONADDR - EXYNOS_CORE_PBASE) + EXYNOS_CORE_VBASE) -#ifdef SSCOM0CONSOLE +#ifdef SSCOM2CONSOLE #define SSCON_CHANNEL 0 #define CONADDR (EXYNOS_CORE_PBASE + EXYNOS5_UART2_OFFSET) #endif
CVS commit: src/usr.sbin/rtadvd
Module Name:src Committed By: ozaki-r Date: Wed Nov 11 07:49:59 UTC 2015 Added Files: src/usr.sbin/rtadvd: prog_ops.h rtadvd_hostops.c rtadvd_rumpops.c Log Message: Introduce rump.rtadvd It is used to write ATF tests for RA. >From s-yamaguchi@IIJ. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/usr.sbin/rtadvd/prog_ops.h \ src/usr.sbin/rtadvd/rtadvd_hostops.c src/usr.sbin/rtadvd/rtadvd_rumpops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/usr.sbin/rtadvd/prog_ops.h diff -u /dev/null src/usr.sbin/rtadvd/prog_ops.h:1.1 --- /dev/null Wed Nov 11 07:49:59 2015 +++ src/usr.sbin/rtadvd/prog_ops.h Wed Nov 11 07:49:59 2015 @@ -0,0 +1,84 @@ +#ifndef _PROG_OPS_H_ +#define _PROG_OPS_H_ + +#include +#include +#include + +#ifndef CRUNCHOPS +struct prog_ops { + int (*op_init)(void); + int (*op_daemon)(int, int); + + int (*op_sysctl)(const int *, u_int, void *, size_t *, + const void *, size_t); + int (*op_ioctl)(int, unsigned long, ...); + + int (*op_socket)(int, int, int); + int (*op_open)(const char *, int, ...); + int (*op_close)(int); + pid_t (*op_getpid)(void); + + ssize_t (*op_read)(int, void *, size_t); + ssize_t (*op_write)(int, const void *, size_t); + + int (*op_chdir)(const char *); + int (*op_chroot)(const char *); + + int (*op_setuid)(uid_t); + int (*op_setgid)(gid_t); + int (*op_setgroups)(int, const gid_t *); + + ssize_t (*op_recvmsg)(int, struct msghdr *, int); + ssize_t (*op_sendmsg)(int, const struct msghdr *, int); + + int (*op_setsockopt)(int, int, int, const void *, socklen_t); + int (*op_poll)(struct pollfd *, u_int, int); + int (*op_clock_gettime)(clockid_t, struct timespec *); +}; +extern const struct prog_ops prog_ops; + +#define prog_init prog_ops.op_init +#define prog_daemon prog_ops.op_daemon +#define prog_socket prog_ops.op_socket +#define prog_open prog_ops.op_open +#define prog_close prog_ops.op_close +#define prog_getpid prog_ops.op_getpid +#define prog_read prog_ops.op_read +#define prog_write prog_ops.op_write +#define prog_sysctl prog_ops.op_sysctl +#define prog_ioctl prog_ops.op_ioctl +#define prog_chdir prog_ops.op_chdir +#define prog_chroot prog_ops.op_chroot +#define prog_setuid prog_ops.op_setuid +#define prog_setgid prog_ops.op_setgid +#define prog_setgroups prog_ops.op_setgroups +#define prog_recvmsg prog_ops.op_recvmsg +#define prog_sendmsg prog_ops.op_sendmsg +#define prog_setsockopt prog_ops.op_setsockopt +#define prog_poll prog_ops.op_poll +#define prog_clock_gettime prog_ops.op_clock_gettime +#else +#define prog_init ((int (*)(void))NULL) +#define prog_daemon daemon +#define prog_socket socket +#define prog_open open +#define prog_close close +#define prog_getpid getpid +#define prog_read read +#define prog_write write +#define prog_sysctl sysctl +#define prog_ioctl ioctl +#define prog_chdir chdir +#define prog_chroot chroot +#define prog_setuid setuid +#define prog_setgid setgid +#define prog_setgroups setgroups +#define prog_recvmsg recvmsg +#define prog_sendmsg sendmsg +#define prog_setsockopt setsockopt +#define prog_poll poll +#define prog_clock_gettime clock_gettime +#endif + +#endif /* _PROG_OPS_H_ */ Index: src/usr.sbin/rtadvd/rtadvd_hostops.c diff -u /dev/null src/usr.sbin/rtadvd/rtadvd_hostops.c:1.1 --- /dev/null Wed Nov 11 07:49:59 2015 +++ src/usr.sbin/rtadvd/rtadvd_hostops.c Wed Nov 11 07:49:59 2015 @@ -0,0 +1,40 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "prog_ops.h" + +const struct prog_ops prog_ops = { + .op_daemon = daemon, + .op_socket = socket, + .op_open = open, + .op_close = close, + .op_getpid = getpid, + + .op_read = read, + .op_write = write, + + .op_sysctl = sysctl, + .op_ioctl = ioctl, + + .op_chdir = chdir, + .op_chroot = chroot, + + .op_setuid = setuid, + .op_setgid = setgid, + .op_setgroups = setgroups, + + .op_recvmsg = recvmsg, + .op_sendmsg = sendmsg, + + .op_setsockopt = setsockopt, + .op_poll = poll, + .op_clock_gettime = clock_gettime, +}; Index: src/usr.sbin/rtadvd/rtadvd_rumpops.c diff -u /dev/null src/usr.sbin/rtadvd/rtadvd_rumpops.c:1.1 --- /dev/null Wed Nov 11 07:49:59 2015 +++ src/usr.sbin/rtadvd/rtadvd_rumpops.c Wed Nov 11 07:49:59 2015 @@ -0,0 +1,45 @@ +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "prog_ops.h" + +const struct prog_ops prog_ops = { + .op_init = rumpclient_init, + .op_daemon = rumpclient_daemon, + + .op_socket = rump_sys_socket, + .op_open = rump_sys_open, + .op_close = rump_sys_close, + .op_getpid = rump_sys_getpid, + + .op_read = rump_sys_read, + .op_write = rump_sys_write, + + .op_sysctl = rump_sys___sysctl, + .op_ioctl = rump_sys_ioctl, + + .op_chdir = rump_sys_chdir, + .op_chroot = rump_sys_chroot, + + .op_setuid = rump_sys_setuid, + .op_setgid = rump_sys_setgid, + .op_setgroups = rump_sys_setgroups, + +
CVS commit: src/doc
Module Name:src Committed By: snj Date: Wed Nov 11 06:53:36 UTC 2015 Modified Files: src/doc: BRANCHES Log Message: add an entry for netbsd-7-0 To generate a diff of this commit: cvs rdiff -u -r1.334 -r1.335 src/doc/BRANCHES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/BRANCHES diff -u src/doc/BRANCHES:1.334 src/doc/BRANCHES:1.335 --- src/doc/BRANCHES:1.334 Wed Nov 11 03:14:34 2015 +++ src/doc/BRANCHES Wed Nov 11 06:53:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: BRANCHES,v 1.334 2015/11/11 03:14:34 snj Exp $ +# $NetBSD: BRANCHES,v 1.335 2015/11/11 06:53:36 snj Exp $ # # This file contains a list of branches that exist in the NetBSD CVS # tree and their current state. @@ -289,6 +289,16 @@ Scope: Entire tree. (src + xsrc) Notes: Commits restricted to Release Engineering. +Branch: netbsd-7-0 +Description: Tracking security/critical fixes for NetBSD 7.0 +Status: Active +Start Date: 10 Oct 2015 +End Date: +Base Tag: netbsd-7-0-RELEASE +Maintainer: 7.0 Release Engineering+Scope: Entire tree. (src + xsrc) +Notes: + Commits restricted to Release Engineering. # Individual developers' branches (Active/Dormant):
CVS commit: src/sbin/iscsid
Module Name:src Committed By: tnn Date: Tue Nov 10 12:41:18 UTC 2015 Modified Files: src/sbin/iscsid: iscsid.8 Log Message: fix iSCSI RFC number To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sbin/iscsid/iscsid.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/iscsid/iscsid.8 diff -u src/sbin/iscsid/iscsid.8:1.11 src/sbin/iscsid/iscsid.8:1.12 --- src/sbin/iscsid/iscsid.8:1.11 Sun Jul 6 14:41:24 2014 +++ src/sbin/iscsid/iscsid.8 Tue Nov 10 12:41:18 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: iscsid.8,v 1.11 2014/07/06 14:41:24 zafer Exp $ +.\" $NetBSD: iscsid.8,v 1.12 2015/11/10 12:41:18 tnn Exp $ .\" .\" Copyright (c) 2011 Alistair Crooks.\" All rights reserved. @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 6, 2014 +.Dd November 10, 2015 .Dt ISCSID 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh DESCRIPTION The iSCSI initiator runs as a kernel driver, and provides access to iSCSI targets running across a network using the iSCSI protocol, -RFC 3270. +RFC 3720. The .Nm utility itself interfaces to the kernel iSCSI driver, and also
CVS commit: [nick-nhusb] src/sys/dev/usb
Module Name:src Committed By: skrll Date: Tue Nov 10 13:41:49 UTC 2015 Modified Files: src/sys/dev/usb [nick-nhusb]: usb_mem.c Log Message: Allow sleeping in usb_block_allocmem - we're nearly there in the HCDs To generate a diff of this commit: cvs rdiff -u -r1.65.2.10 -r1.65.2.11 src/sys/dev/usb/usb_mem.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/usb/usb_mem.c diff -u src/sys/dev/usb/usb_mem.c:1.65.2.10 src/sys/dev/usb/usb_mem.c:1.65.2.11 --- src/sys/dev/usb/usb_mem.c:1.65.2.10 Tue Sep 29 11:38:29 2015 +++ src/sys/dev/usb/usb_mem.c Tue Nov 10 13:41:49 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usb_mem.c,v 1.65.2.10 2015/09/29 11:38:29 skrll Exp $ */ +/* $NetBSD: usb_mem.c,v 1.65.2.11 2015/11/10 13:41:49 skrll Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.65.2.10 2015/09/29 11:38:29 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.65.2.11 2015/11/10 13:41:49 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -137,6 +137,8 @@ usb_block_allocmem(bus_dma_tag_t tag, si } DPRINTFN(6, "no free", 0, 0, 0, 0); + mutex_exit(_blk_lock); + b = kmem_zalloc(sizeof(*b), KM_SLEEP); if (b == NULL) return USBD_NOMEM; @@ -160,22 +162,22 @@ usb_block_allocmem(bus_dma_tag_t tag, si error = bus_dmamem_alloc(tag, b->size, align, 0, b->segs, b->nsegs, - >nsegs, BUS_DMA_NOWAIT); + >nsegs, BUS_DMA_WAITOK); if (error) goto free0; error = bus_dmamem_map(tag, b->segs, b->nsegs, b->size, - >kaddr, BUS_DMA_NOWAIT|BUS_DMA_COHERENT); + >kaddr, BUS_DMA_WAITOK|BUS_DMA_COHERENT); if (error) goto free1; error = bus_dmamap_create(tag, b->size, b->nsegs, b->size, - 0, BUS_DMA_NOWAIT, >map); + 0, BUS_DMA_WAITOK, >map); if (error) goto unmap; error = bus_dmamap_load(tag, b->map, b->kaddr, b->size, NULL, -BUS_DMA_NOWAIT); +BUS_DMA_WAITOK); if (error) goto destroy; @@ -183,6 +185,7 @@ usb_block_allocmem(bus_dma_tag_t tag, si #ifdef USB_FRAG_DMA_WORKAROUND memset(b->kaddr, 0, b->size); #endif + mutex_enter(_blk_lock); return USBD_NORMAL_COMPLETION;
CVS commit: src/sys/net
Module Name:src Committed By: knakahara Date: Wed Nov 11 02:57:17 UTC 2015 Modified Files: src/sys/net: if_gif.c Log Message: fix panic after "ifconfig gifX tunnel src dst" failed for the reason of address pair duplication. e.g. # ifconfig gif0 create # ifconfig gif0 tunnel 192.168.0.1 192.168.0.2 # ifconfig gif0 inet 172.16.0.1/24 172.16.0.2 # route add 10.1.0.0/24 172.16.0.1 # ifconfig gif1 create # ifconfig gif1 tunnel 192.168.0.1 192.168.0.3 # ifconfig gif0 tunnel 192.168.0.1 192.168.0.3 ifconfig: SIOCSLIFPHYADDR: Can't assign requested address # expected # ping 10.1.0.1 (panic) To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/net/if_gif.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/net/if_gif.c diff -u src/sys/net/if_gif.c:1.90 src/sys/net/if_gif.c:1.91 --- src/sys/net/if_gif.c:1.90 Tue Nov 10 18:22:46 2015 +++ src/sys/net/if_gif.c Wed Nov 11 02:57:17 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gif.c,v 1.90 2015/11/10 18:22:46 christos Exp $ */ +/* $NetBSD: if_gif.c,v 1.91 2015/11/11 02:57:17 knakahara Exp $ */ /* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.90 2015/11/10 18:22:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.91 2015/11/11 02:57:17 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -678,7 +678,8 @@ gif_set_tunnel(struct ifnet *ifp, struct if (sockaddr_cmp(sc2->gif_pdst, dst) == 0 && sockaddr_cmp(sc2->gif_psrc, src) == 0) { error = EADDRNOTAVAIL; - goto bad; + /* continue to use the old configureation. */ + goto out; } /* XXX both end must be valid? (I mean, not 0.0.0.0) */ @@ -747,9 +748,8 @@ gif_set_tunnel(struct ifnet *ifp, struct sockaddr_free(odst); ifp->if_flags |= IFF_RUNNING; - splx(s); - - return 0; + error = 0; + goto out; rollback: if (sc->gif_psrc != NULL) @@ -758,7 +758,7 @@ rollback: sockaddr_free(sc->gif_pdst); sc->gif_psrc = osrc; sc->gif_pdst = odst; -bad: + if (sc->gif_si) { softint_disestablish(sc->gif_si); sc->gif_si = NULL; @@ -768,8 +768,8 @@ bad: ifp->if_flags |= IFF_RUNNING; else ifp->if_flags &= ~IFF_RUNNING; +out: splx(s); - return error; }
CVS commit: src/sys/net
Module Name:src Committed By: knakahara Date: Wed Nov 11 03:57:57 UTC 2015 Modified Files: src/sys/net: if_gif.c Log Message: fix CID 980463 To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/net/if_gif.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/net/if_gif.c diff -u src/sys/net/if_gif.c:1.91 src/sys/net/if_gif.c:1.92 --- src/sys/net/if_gif.c:1.91 Wed Nov 11 02:57:17 2015 +++ src/sys/net/if_gif.c Wed Nov 11 03:57:57 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gif.c,v 1.91 2015/11/11 02:57:17 knakahara Exp $ */ +/* $NetBSD: if_gif.c,v 1.92 2015/11/11 03:57:57 knakahara Exp $ */ /* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.91 2015/11/11 02:57:17 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.92 2015/11/11 03:57:57 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -747,7 +747,6 @@ gif_set_tunnel(struct ifnet *ifp, struct if (odst) sockaddr_free(odst); - ifp->if_flags |= IFF_RUNNING; error = 0; goto out; @@ -764,11 +763,12 @@ rollback: sc->gif_si = NULL; } +out: if (sc->gif_psrc && sc->gif_pdst) ifp->if_flags |= IFF_RUNNING; else ifp->if_flags &= ~IFF_RUNNING; -out: + splx(s); return error; }
CVS commit: src/doc
Module Name:src Committed By: snj Date: Wed Nov 11 03:14:34 UTC 2015 Modified Files: src/doc: BRANCHES Log Message: Note that the netbsd-5{,-1,-2} branches have been terminated. Goodbye, dear friends. To generate a diff of this commit: cvs rdiff -u -r1.333 -r1.334 src/doc/BRANCHES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/BRANCHES diff -u src/doc/BRANCHES:1.333 src/doc/BRANCHES:1.334 --- src/doc/BRANCHES:1.333 Thu Oct 2 09:18:44 2014 +++ src/doc/BRANCHES Wed Nov 11 03:14:34 2015 @@ -1,4 +1,4 @@ -# $NetBSD: BRANCHES,v 1.333 2014/10/02 09:18:44 apb Exp $ +# $NetBSD: BRANCHES,v 1.334 2015/11/11 03:14:34 snj Exp $ # # This file contains a list of branches that exist in the NetBSD CVS # tree and their current state. @@ -206,9 +206,9 @@ Notes: Branch: netbsd-5 Description: The NetBSD 5 release branch -Status: Active +Status: Terminated Start Date: 31 Oct 2008 -End Date: +End Date: 9 Nov 2015 Base Tag: netbsd-5-base Maintainer: 5.0 Release EngineeringScope: Entire tree. (src + xsrc) @@ -227,9 +227,9 @@ Notes: Commits restricted to Release En Branch: netbsd-5-1 Description: Tracking security/critical fixes for NetBSD 5.1 -Status: Active +Status: Terminated Start Date: -End Date: +End Date: 9 Nov 2015 Base Tag: netbsd-5-1-RELEASE Maintainer: 5.1 Release Engineering Scope: Entire tree. (src + xsrc) @@ -237,9 +237,9 @@ Notes: Commits restricted to Release En Branch: netbsd-5-2 Description: Tracking security/critical fixes for NetBSD 5.2 -Status: Active +Status: Terminated Start Date: -End Date: +End Date: 9 Nov 2015 Base Tag: netbsd-5-2-RELEASE Maintainer: 5.2 Release Engineering Scope: Entire tree. (src + xsrc)
CVS commit: src
Module Name:src Committed By: ozaki-r Date: Wed Nov 11 07:52:57 UTC 2015 Modified Files: src/distrib/sets/lists/tests: mi src/tests/net/ndp: Makefile Added Files: src/tests/net/ndp: t_ra.sh Log Message: Add tests for RA >From s-yamaguchi@IIJ (with some tweaks by me) To generate a diff of this commit: cvs rdiff -u -r1.651 -r1.652 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.1 -r1.2 src/tests/net/ndp/Makefile cvs rdiff -u -r0 -r1.1 src/tests/net/ndp/t_ra.sh 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/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.651 src/distrib/sets/lists/tests/mi:1.652 --- src/distrib/sets/lists/tests/mi:1.651 Thu Nov 5 00:02:59 2015 +++ src/distrib/sets/lists/tests/mi Wed Nov 11 07:52:57 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.651 2015/11/05 00:02:59 knakahara Exp $ +# $NetBSD: mi,v 1.652 2015/11/11 07:52:57 ozaki-r Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3186,6 +3186,7 @@ ./usr/tests/net/ndp/Kyuafile tests-net-tests atf,rump,kyua ./usr/tests/net/ndp/t_dad tests-net-tests atf,rump ./usr/tests/net/ndp/t_ndp tests-net-tests atf,rump +./usr/tests/net/ndp/t_ra tests-net-tests atf,rump ./usr/tests/net/nettests-net-tests compattestfile,atf ./usr/tests/net/net/Atffile tests-net-tests compattestfile,atf ./usr/tests/net/net/Kyuafile tests-net-tests compattestfile,atf,kyua Index: src/tests/net/ndp/Makefile diff -u src/tests/net/ndp/Makefile:1.1 src/tests/net/ndp/Makefile:1.2 --- src/tests/net/ndp/Makefile:1.1 Mon Aug 3 09:54:20 2015 +++ src/tests/net/ndp/Makefile Wed Nov 11 07:52:57 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2015/08/03 09:54:20 ozaki-r Exp $ +# $NetBSD: Makefile,v 1.2 2015/11/11 07:52:57 ozaki-r Exp $ # .include @@ -7,5 +7,6 @@ TESTSDIR= ${TESTSBASE}/net/ndp TESTS_SH= t_dad TESTS_SH+= t_ndp +TESTS_SH+= t_ra .include Added files: Index: src/tests/net/ndp/t_ra.sh diff -u /dev/null src/tests/net/ndp/t_ra.sh:1.1 --- /dev/null Wed Nov 11 07:52:57 2015 +++ src/tests/net/ndp/t_ra.sh Wed Nov 11 07:52:57 2015 @@ -0,0 +1,140 @@ +#! /usr/bin/env atf-sh +RUMPFLAGS="-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6" +RUMPFLAGS="${RUMPFLAGS} -lrumpnet_shmif" +RUMPFLAGS="${RUMPFLAGS} -lrumpvfs -lrumpfs_ffs" + +RUMPSRV=unix://r1 +RUMPCLI=unix://r2 +IP6SRV=fc00:1::1 +IP6CLI=fc00:2::2 +PIDFILE=/var/run/rump.rtadvd.pid +CONFIG=./rtadvd.conf +DEBUG=true + +setup_shmif0() +{ + local IP6ADDR=${1} + shift + + atf_check -s exit:0 rump.ifconfig shmif0 create + atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1 + atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${IP6ADDR} + atf_check -s exit:0 rump.ifconfig shmif0 up + + $DEBUG && rump.ifconfig +} + +wait_term() +{ + local PIDFILE=${1} + shift + + while [ -f ${PIDFILE} ] + do + sleep 0.2 + done + + return 0 +} + +create_rtadvdconfig() +{ + + cat << _EOF > ${CONFIG} +shmif0:\ + :mtu#1300:maxinterval#4:mininterval#3: +_EOF +} + +atf_test_case basic cleanup +basic_head() +{ + + atf_set "descr" "Tests for basic functions of router advaertisement(RA)" + atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig" +} + +basic_body() +{ + + atf_check -s exit:0 rump_server ${RUMPFLAGS} ${RUMPSRV} + atf_check -s exit:0 rump_server ${RUMPFLAGS} ${RUMPCLI} + + export RUMP_SERVER=${RUMPSRV} + setup_shmif0 ${IP6SRV} + atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.forwarding=1 + export LD_PRELOAD=/usr/lib/librumphijack.so + atf_check -s exit:0 mkdir -p /rump/var/chroot/rtadvd + unset LD_PRELOAD + unset RUMP_SERVER + + export RUMP_SERVER=${RUMPCLI} + setup_shmif0 ${IP6CLI} + $DEBUG && rump.ndp -n -a + atf_check -s exit:0 -o match:'= 0' rump.sysctl net.inet6.ip6.accept_rtadv + unset RUMP_SERVER + + create_rtadvdconfig + + export RUMP_SERVER=${RUMPSRV} + atf_check -s exit:0 rump.rtadvd -c ${CONFIG} shmif0 + atf_check -s exit:0 sleep 3 + atf_check -s exit:0 -o ignore -e empty cat ${PIDFILE} + unset RUMP_SERVER + + export RUMP_SERVER=${RUMPCLI} + atf_check -s exit:0 -o empty rump.ndp -r + atf_check -s exit:0 -o not-match:'advertised' rump.ndp -p + atf_check -s exit:0 -o match:'linkmtu=0' rump.ndp -n -i shmif0 + atf_check -s exit:0 -o not-match:'S R' rump.ndp -n -a + atf_check -s exit:0 -o not-match:'fc00:1:' rump.ndp -n -a + atf_check -s exit:0 -o not-match:'fc00:1:' rump.ifconfig shmif0 inet6 + unset RUMP_SERVER + + atf_check -s exit:0 kill -TERM `cat ${PIDFILE}` + wait_term ${PIDFILE} + + export RUMP_SERVER=${RUMPCLI} + atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1 + unset RUMP_SERVER + + export RUMP_SERVER=${RUMPSRV} + atf_check -s exit:0 rump.rtadvd -c ${CONFIG} shmif0 + atf_check -s exit:0 sleep 3 + atf_check -s exit:0 -o ignore -e empty cat ${PIDFILE} + unset RUMP_SERVER + + export RUMP_SERVER=${RUMPCLI} + $DEBUG &&