CVS commit: src/sys/fs/msdosfs
Module Name:src Committed By: mlelstv Date: Sun Mar 6 07:33:25 UTC 2016 Modified Files: src/sys/fs/msdosfs: msdosfs_conv.c Log Message: Use KASSERT for conditions that cannot be met with current parameters. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/fs/msdosfs/msdosfs_conv.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/fs/msdosfs/msdosfs_conv.c diff -u src/sys/fs/msdosfs/msdosfs_conv.c:1.15 src/sys/fs/msdosfs/msdosfs_conv.c:1.16 --- src/sys/fs/msdosfs/msdosfs_conv.c:1.15 Sat Feb 6 10:40:58 2016 +++ src/sys/fs/msdosfs/msdosfs_conv.c Sun Mar 6 07:33:25 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_conv.c,v 1.15 2016/02/06 10:40:58 mlelstv Exp $ */ +/* $NetBSD: msdosfs_conv.c,v 1.16 2016/03/06 07:33:25 mlelstv Exp $ */ /*- * Copyright (C) 1995, 1997 Wolfgang Solfrank. @@ -52,8 +52,13 @@ #include "nbtool_config.h" #endif +#ifndef _KERNEL +#include +#define KASSERT(x) assert(x) +#endif + #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.15 2016/02/06 10:40:58 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.16 2016/03/06 07:33:25 mlelstv Exp $"); /* * System include files. @@ -685,8 +690,8 @@ win2unixfn(struct winentry *wep, struct len = utf8 ? ucs2utf8str(wn, WIN_CHARS, buf, sizeof(buf)) : ucs2char8str(wn, WIN_CHARS, buf, sizeof(buf)); - if ((size_t)len > sizeof(dp->d_name) - 1) - return -1; + KASSERT(len >= 0); + KASSERT((size_t)len <= MIN(sizeof(buf), sizeof(dp->d_name)-1)); /* * Prepend name segment to directory entry @@ -702,6 +707,9 @@ win2unixfn(struct winentry *wep, struct *namlen += len; if (*namlen > sizeof(dp->d_name) - 1) *namlen = sizeof(dp->d_name) - 1; + + KASSERT(*namlen >= len); + memmove(&dp->d_name[len], &dp->d_name[0], *namlen - len); memcpy(dp->d_name, buf, len);
CVS commit: src/sys/netipsec
Module Name:src Committed By: christos Date: Sun Mar 6 04:19:51 UTC 2016 Modified Files: src/sys/netipsec: key.c Log Message: Simplify the port comparison code further. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 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.95 src/sys/netipsec/key.c:1.96 --- src/sys/netipsec/key.c:1.95 Sat Mar 5 15:26:07 2016 +++ src/sys/netipsec/key.c Sat Mar 5 23:19:51 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.95 2016/03/05 20:26:07 christos Exp $ */ +/* $NetBSD: key.c,v 1.96 2016/03/06 04:19:51 christos 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.95 2016/03/05 20:26:07 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.96 2016/03/06 04:19:51 christos Exp $"); /* * This code is referd to RFC 2367 @@ -113,6 +113,10 @@ __KERNEL_RCSID(0, "$NetBSD: key.c,v 1.95 #define FULLMASK 0xff #define _BITS(bytes) ((bytes) << 3) +#define PORT_NONE 0 +#define PORT_LOOSE 1 +#define PORT_STRICT 2 + percpu_t *pfkeystat_percpu; /* @@ -676,7 +680,7 @@ key_allocsp2(u_int32_t spi, /* NB: spi's must exist and match */ if (!sp->req || !sp->req->sav || sp->req->sav->spi != spi) continue; - if (key_sockaddrcmp(&sp->spidx.dst.sa, &dst->sa, 1) == 0) + if (key_sockaddrcmp(&sp->spidx.dst.sa, &dst->sa, PORT_STRICT) == 0) goto found; } sp = NULL; @@ -748,13 +752,13 @@ key_gettunnel(const struct sockaddr *osr if (!key_cmpspidx_withmask(&sp->spidx, &spidx)) continue; } else { -if (key_sockaddrcmp(&r1->saidx.src.sa, isrc, 0) || -key_sockaddrcmp(&r1->saidx.dst.sa, idst, 0)) +if (key_sockaddrcmp(&r1->saidx.src.sa, isrc, PORT_NONE) || +key_sockaddrcmp(&r1->saidx.dst.sa, idst, PORT_NONE)) continue; } - if (key_sockaddrcmp(&r2->saidx.src.sa, osrc, 0) || - key_sockaddrcmp(&r2->saidx.dst.sa, odst, 0)) + if (key_sockaddrcmp(&r2->saidx.src.sa, osrc, PORT_NONE) || + key_sockaddrcmp(&r2->saidx.dst.sa, odst, PORT_NONE)) continue; goto found; @@ -1086,9 +1090,8 @@ key_allocsa( struct secasvar *sav; u_int stateidx, state; const u_int *saorder_state_valid; - int arraysize; + int arraysize, chkport; int s; - int chkport = 0; int must_check_spi = 1; int must_check_alg = 0; @@ -1096,7 +1099,9 @@ key_allocsa( u_int8_t algo = 0; if ((sport != 0) && (dport != 0)) - chkport = 1; + chkport = PORT_STRICT; + else + chkport = PORT_NONE; IPSEC_ASSERT(dst != NULL, ("key_allocsa: null dst address")); @@ -1179,7 +1184,7 @@ key_allocsa( /* Fix port in src->sa */ /* check src address */ -if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, 0) != 0) +if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, PORT_NONE) != 0) continue; #endif /* fix port of dst address XXX*/ @@ -4191,19 +4196,6 @@ key_ismyaddr6(const struct sockaddr_in6 } #endif /*INET6*/ -static in_port_t -key_getport(const void *v) -{ - const struct sockaddr *sa = v; - switch (sa->sa_family) { - case AF_INET: - return ((const struct sockaddr_in *)v)->sin_port; - case AF_INET6: - return ((const struct sockaddr_in6 *)v)->sin6_port; - default: - return 0; - } -} /* * compare two secasindex structure. * flag can specify to compare 2 saidxes. @@ -4222,7 +4214,7 @@ key_cmpsaidx( const struct secasindex *saidx1, int flag) { - int chkport = 0; + int chkport; const struct sockaddr *sa0src, *sa0dst, *sa1src, *sa1dst; /* sanity */ @@ -4275,10 +4267,10 @@ key_cmpsaidx( * in the SPD: This means we have a non-generated * SPD which can't know UDP ports. */ - if (saidx1->mode == IPSEC_MODE_TUNNEL) { - chkport = key_getport(sa0src) && key_getport(sa0dst) && - key_getport(sa1src) && key_getport(sa1dst); - } + if (saidx1->mode == IPSEC_MODE_TUNNEL) + chkport = PORT_LOOSE; + else + chkport = PORT_NONE; if (key_sockaddrcmp(sa0src, sa1src, chkport) != 0) { return 0; @@ -4317,8 +4309,8 @@ key_cmpspidx_exactly( || spidx0->ul_proto != spidx1->ul_proto) return 0; - return key_sockaddrcmp(&spidx0->src.sa, &spidx1->src.sa, 1) == 0 && - key_sockaddrcmp(&spidx0->dst.sa, &spidx1->dst.sa, 1) == 0; + return key_sockaddrcmp(&spidx0->src.sa, &spidx1->src.sa, PORT_STRICT) == 0 && + key_sockaddrcmp(&spidx0->dst.sa, &spidx1->dst.sa, PORT_STRICT) == 0; } /* @@ -4424,19 +4416,38 @@ key_cmpspidx_withmask( /* returns 0 on match */ static int +key_portcomp(in_port_t port1, in_port_t port2, int howport) +{ + switch (howport) { + case PORT_NONE: + return 0; + case PORT_LOOSE: + if (port1 == 0 || port2 == 0) + return 0; + /*FALLTHROUGH*/ + case PORT_STRICT: + if (port1 !
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: mrg Date: Sat Mar 5 22:10:39 UTC 2016 Modified Files: src/usr.bin/audiocfg: audiodev.c Log Message: if opening the audio device fails, try opening again with write-only. this allows my playback-only usb device to be listed and tested. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.bin/audiocfg/audiodev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/audiocfg/audiodev.c diff -u src/usr.bin/audiocfg/audiodev.c:1.5 src/usr.bin/audiocfg/audiodev.c:1.6 --- src/usr.bin/audiocfg/audiodev.c:1.5 Sun Aug 11 06:31:00 2013 +++ src/usr.bin/audiocfg/audiodev.c Sat Mar 5 22:10:39 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.c,v 1.5 2013/08/11 06:31:00 dholland Exp $ */ +/* $NetBSD: audiodev.c,v 1.6 2016/03/05 22:10:39 mrg Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -89,8 +89,11 @@ audiodev_getinfo(struct audiodev *adev) adev->defaultdev = true; adev->fd = open(adev->path, O_RDWR); - if (adev->fd == -1) - return -1; + if (adev->fd == -1) { + adev->fd = open(adev->path, O_WRONLY); + if (adev->fd == -1) + return -1; + } if (ioctl(adev->fd, AUDIO_GETDEV, &adev->audio_device) == -1) { close(adev->fd); return -1;
CVS commit: src/sys/netipsec
Module Name:src Committed By: christos Date: Sat Mar 5 20:26:07 UTC 2016 Modified Files: src/sys/netipsec: key.c Log Message: kill stray & To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 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.94 src/sys/netipsec/key.c:1.95 --- src/sys/netipsec/key.c:1.94 Sat Mar 5 15:13:40 2016 +++ src/sys/netipsec/key.c Sat Mar 5 15:26:07 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.94 2016/03/05 20:13:40 christos Exp $ */ +/* $NetBSD: key.c,v 1.95 2016/03/05 20:26:07 christos 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.94 2016/03/05 20:13:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.95 2016/03/05 20:26:07 christos Exp $"); /* * This code is referd to RFC 2367 @@ -4283,7 +4283,7 @@ key_cmpsaidx( if (key_sockaddrcmp(sa0src, sa1src, chkport) != 0) { return 0; } - if (key_sockaddrcmp(sa0dst, &sa1dst, chkport) != 0) { + if (key_sockaddrcmp(sa0dst, sa1dst, chkport) != 0) { return 0; } }
CVS commit: src/sys/netipsec
Module Name:src Committed By: christos Date: Sat Mar 5 20:13:40 UTC 2016 Modified Files: src/sys/netipsec: key.c Log Message: Fix port matching; we need to ignore ports when they are 0 not only in the second saidx but the first one too. Fixes NAT-T issue with NetBSD being the host behind NAT. To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 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.93 src/sys/netipsec/key.c:1.94 --- src/sys/netipsec/key.c:1.93 Sat Mar 5 15:12:23 2016 +++ src/sys/netipsec/key.c Sat Mar 5 15:13:40 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.93 2016/03/05 20:12:23 christos Exp $ */ +/* $NetBSD: key.c,v 1.94 2016/03/05 20:13:40 christos 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.93 2016/03/05 20:12:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.94 2016/03/05 20:13:40 christos Exp $"); /* * This code is referd to RFC 2367 @@ -4191,6 +4191,19 @@ key_ismyaddr6(const struct sockaddr_in6 } #endif /*INET6*/ +static in_port_t +key_getport(const void *v) +{ + const struct sockaddr *sa = v; + switch (sa->sa_family) { + case AF_INET: + return ((const struct sockaddr_in *)v)->sin_port; + case AF_INET6: + return ((const struct sockaddr_in6 *)v)->sin6_port; + default: + return 0; + } +} /* * compare two secasindex structure. * flag can specify to compare 2 saidxes. @@ -4210,6 +4223,7 @@ key_cmpsaidx( int flag) { int chkport = 0; + const struct sockaddr *sa0src, *sa0dst, *sa1src, *sa1dst; /* sanity */ if (saidx0 == NULL && saidx1 == NULL) @@ -4248,29 +4262,28 @@ key_cmpsaidx( return 0; } - /* - * If NAT-T is enabled, check ports for tunnel mode. - * Don't do it for transport mode, as there is no - * port information available in the SP. - * Also don't check ports if they are set to zero - * in the SPD: This means we have a non-generated - * SPD which can't know UDP ports. - */ - if (saidx1->mode == IPSEC_MODE_TUNNEL && - const struct sockaddr *)(&saidx1->src))->sa_family == AF_INET && - ((const struct sockaddr *)(&saidx1->dst))->sa_family == AF_INET && - ((const struct sockaddr_in *)(&saidx1->src))->sin_port && - ((const struct sockaddr_in *)(&saidx1->dst))->sin_port) || - (((const struct sockaddr *)(&saidx1->src))->sa_family == AF_INET6 && - ((const struct sockaddr *)(&saidx1->dst))->sa_family == AF_INET6 && - ((const struct sockaddr_in6 *)(&saidx1->src))->sin6_port && - ((const struct sockaddr_in6 *)(&saidx1->dst))->sin6_port))) - chkport = 1; - if (key_sockaddrcmp(&saidx0->src.sa, &saidx1->src.sa, chkport) != 0) { + sa0src = &saidx0->src.sa; + sa0dst = &saidx0->dst.sa; + sa1src = &saidx1->src.sa; + sa1dst = &saidx1->dst.sa; + /* + * If NAT-T is enabled, check ports for tunnel mode. + * Don't do it for transport mode, as there is no + * port information available in the SP. + * Also don't check ports if they are set to zero + * in the SPD: This means we have a non-generated + * SPD which can't know UDP ports. + */ + if (saidx1->mode == IPSEC_MODE_TUNNEL) { + chkport = key_getport(sa0src) && key_getport(sa0dst) && + key_getport(sa1src) && key_getport(sa1dst); + } + + if (key_sockaddrcmp(sa0src, sa1src, chkport) != 0) { return 0; } - if (key_sockaddrcmp(&saidx0->dst.sa, &saidx1->dst.sa, chkport) != 0) { + if (key_sockaddrcmp(sa0dst, &sa1dst, chkport) != 0) { return 0; } }
CVS commit: src/sys/netipsec
Module Name:src Committed By: christos Date: Sat Mar 5 20:12:23 UTC 2016 Modified Files: src/sys/netipsec: key.c Log Message: gather more information from mbuf. To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 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.92 src/sys/netipsec/key.c:1.93 --- src/sys/netipsec/key.c:1.92 Sat Mar 5 15:11:09 2016 +++ src/sys/netipsec/key.c Sat Mar 5 15:12:23 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.92 2016/03/05 20:11:09 christos Exp $ */ +/* $NetBSD: key.c,v 1.93 2016/03/05 20:12:23 christos 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.92 2016/03/05 20:11:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.93 2016/03/05 20:12:23 christos Exp $"); /* * This code is referd to RFC 2367 @@ -5659,11 +5659,14 @@ key_getmsgbuf_x1(struct mbuf *m, const s panic("key_getmsgbuf_x1: NULL pointer is passed"); /* create new sadb_msg to reply. */ - n = key_gather_mbuf(m, mhp, 1, 9, SADB_EXT_RESERVED, + n = key_gather_mbuf(m, mhp, 1, 15, SADB_EXT_RESERVED, SADB_EXT_SA, SADB_X_EXT_SA2, SADB_EXT_ADDRESS_SRC, SADB_EXT_ADDRESS_DST, SADB_EXT_LIFETIME_HARD, SADB_EXT_LIFETIME_SOFT, - SADB_EXT_IDENTITY_SRC, SADB_EXT_IDENTITY_DST); + SADB_EXT_IDENTITY_SRC, SADB_EXT_IDENTITY_DST, + SADB_X_EXT_NAT_T_TYPE, SADB_X_EXT_NAT_T_SPORT, + SADB_X_EXT_NAT_T_DPORT, SADB_X_EXT_NAT_T_OAI, + SADB_X_EXT_NAT_T_OAR, SADB_X_EXT_NAT_T_FRAG); if (!n) return NULL;
CVS commit: src/sys/netipsec
Module Name:src Committed By: christos Date: Sat Mar 5 20:11:09 UTC 2016 Modified Files: src/sys/netipsec: key.c key_debug.h Log Message: Add more debugging, no functional change. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/netipsec/key.c cvs rdiff -u -r1.6 -r1.7 src/sys/netipsec/key_debug.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/netipsec/key.c diff -u src/sys/netipsec/key.c:1.91 src/sys/netipsec/key.c:1.92 --- src/sys/netipsec/key.c:1.91 Sun Jun 15 23:34:45 2014 +++ src/sys/netipsec/key.c Sat Mar 5 15:11:09 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: key.c,v 1.91 2014/06/16 03:34:45 christos Exp $ */ +/* $NetBSD: key.c,v 1.92 2016/03/05 20:11:09 christos 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.91 2014/06/16 03:34:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.92 2016/03/05 20:11:09 christos Exp $"); /* * This code is referd to RFC 2367 @@ -1100,9 +1100,6 @@ key_allocsa( IPSEC_ASSERT(dst != NULL, ("key_allocsa: null dst address")); - KEYDEBUG(KEYDEBUG_IPSEC_STAMP, - printf("DP %s from %s:%u\n", __func__, where, tag)); - /* * XXX IPCOMP case * We use cpi to define spi here. In the case where cpi <= @@ -1121,6 +1118,10 @@ key_allocsa( must_check_alg = 1; } } + KEYDEBUG(KEYDEBUG_IPSEC_STAMP, + printf("DP %s from %s:%u check_spi=%d, check_alg=%d\n", + __func__, where, tag, must_check_spi, must_check_alg)); + /* * searching SAD. @@ -1141,19 +1142,38 @@ key_allocsa( for (stateidx = 0; stateidx < arraysize; stateidx++) { state = saorder_state_valid[stateidx]; LIST_FOREACH(sav, &sah->savtree[state], chain) { +KEYDEBUG(KEYDEBUG_MATCH, +printf("try match spi %#x, %#x\n", + ntohl(spi), ntohl(sav->spi))); /* sanity check */ KEY_CHKSASTATE(sav->state, state, "key_allocsav"); /* do not return entries w/ unusable state */ if (sav->state != SADB_SASTATE_MATURE && -sav->state != SADB_SASTATE_DYING) +sav->state != SADB_SASTATE_DYING) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("bad state %d\n", + sav->state)); continue; -if (proto != sav->sah->saidx.proto) +} +if (proto != sav->sah->saidx.proto) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("proto fail %d != %d\n", + proto, sav->sah->saidx.proto)); continue; -if (must_check_spi && spi != sav->spi) +} +if (must_check_spi && spi != sav->spi) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("spi fail %#x != %#x\n", + ntohl(spi), ntohl(sav->spi))); continue; +} /* XXX only on the ipcomp case */ -if (must_check_alg && algo != sav->alg_comp) +if (must_check_alg && algo != sav->alg_comp) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("algo fail %d != %d\n", + algo, sav->alg_comp)); continue; +} #if 0 /* don't check src */ /* Fix port in src->sa */ @@ -4404,19 +4424,43 @@ key_sockaddrcmp( #undef satosin6 #endif #define satosin6(s) ((const struct sockaddr_in6 *)s) - if (sa1->sa_family != sa2->sa_family || sa1->sa_len != sa2->sa_len) + if (sa1->sa_family != sa2->sa_family || sa1->sa_len != sa2->sa_len) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("fam/len fail %d != %d || %d != %d\n", + sa1->sa_family, sa2->sa_family, sa1->sa_len, + sa2->sa_len)); return 1; + } switch (sa1->sa_family) { case AF_INET: - if (sa1->sa_len != sizeof(struct sockaddr_in)) + if (sa1->sa_len != sizeof(struct sockaddr_in)) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("len fail %d != %zu\n", +sa1->sa_len, sizeof(struct sockaddr_in))); return 1; + } if (satosin(sa1)->sin_addr.s_addr != satosin(sa2)->sin_addr.s_addr) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("addr fail %#x != %#x\n", +satosin(sa1)->sin_addr.s_addr, +satosin(sa2)->sin_addr.s_addr)); return 1; } - if (port && satosin(sa1)->sin_port != satosin(sa2)->sin_port) + if (port && satosin(sa1)->sin_port != satosin(sa2)->sin_port) { + KEYDEBUG(KEYDEBUG_MATCH, + printf("port fail %d != %d\n", +satosin(sa1)->sin_port, +satosin(sa2)->sin_port)); return 1; + } + KEYDEBUG(KEYDEBUG_MATCH, + printf("addr success %#x[%d] == %#x[%d]\n", + satosin(sa1)->sin_addr.s_addr, + satosin(sa1)->sin_port, + satosin(sa2)->sin_addr.s_addr, + satosin(sa2)->sin_port)); break; case AF_INET6: if (sa1->sa_len != sizeof(struct sockaddr_in6)) Index: src/sys/netipsec/key_debug.h diff -u src/sys/netipsec/key_debug.h:1.6 src/sys/netipsec/key_debug.h:1.7 --- src/sys/netipsec/key_debug.h:1.6 Mon Feb 21 17:21:40 2011 +++ src/sys/netipsec/key_debug.h Sat Mar 5 15:11:09 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: key_debug.h,v 1.6 2011/02/21 22:21:
CVS commit: src/bin/cp
Module Name:src Committed By: uwe Date: Sat Mar 5 19:48:56 UTC 2016 Modified Files: src/bin/cp: cp.c Log Message: The '-i' flag should work regardless of whether the standard input is a terminal. The Open Group notes this historic behavior and correctly notes that it doesn't make much sense. Note also, that mv(1) has always respected its '-i' regardless of whether the standard input is a terminal. >From Timo Buhrmester. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/bin/cp/cp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/cp/cp.c diff -u src/bin/cp/cp.c:1.58 src/bin/cp/cp.c:1.59 --- src/bin/cp/cp.c:1.58 Wed Jan 4 15:58:37 2012 +++ src/bin/cp/cp.c Sat Mar 5 19:48:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $ */ +/* $NetBSD: cp.c,v 1.59 2016/03/05 19:48:55 uwe Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -43,7 +43,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95"; #else -__RCSID("$NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $"); +__RCSID("$NetBSD: cp.c,v 1.59 2016/03/05 19:48:55 uwe Exp $"); #endif #endif /* not lint */ @@ -145,7 +145,7 @@ main(int argc, char *argv[]) iflag = 0; break; case 'i': - iflag = isatty(fileno(stdin)); + iflag = 1; fflag = 0; break; case 'l':
CVS commit: src/sys/arch
Module Name:src Committed By: riastradh Date: Sat Mar 5 17:08:49 UTC 2016 Modified Files: src/sys/arch/amd64/conf: GENERIC src/sys/arch/i386/conf: GENERIC Log Message: Revert to disabling nouveau by default in x86 GENERIC. Haven't had time to debug the issues that seem to affect pretty much everyone. Maybe soon! To generate a diff of this commit: cvs rdiff -u -r1.424 -r1.425 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.1131 -r1.1132 src/sys/arch/i386/conf/GENERIC 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/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.424 src/sys/arch/amd64/conf/GENERIC:1.425 --- src/sys/arch/amd64/conf/GENERIC:1.424 Sat Feb 13 19:53:23 2016 +++ src/sys/arch/amd64/conf/GENERIC Sat Mar 5 17:08:49 2016 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.424 2016/02/13 19:53:23 riastradh Exp $ +# $NetBSD: GENERIC,v 1.425 2016/03/05 17:08:49 riastradh Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.424 $" +#ident "GENERIC-$Revision: 1.425 $" maxusers 64 # estimated number of users @@ -416,8 +416,8 @@ intelfb* at intelfbbus? radeon* at pci? dev ? function ? radeondrmkmsfb* at radeonfbbus? -nouveau* at pci? dev ? function ? -nouveaufb* at nouveaufbbus? +#nouveau* at pci? dev ? function ? +#nouveaufb* at nouveaufbbus? # Cryptographic Devices Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.1131 src/sys/arch/i386/conf/GENERIC:1.1132 --- src/sys/arch/i386/conf/GENERIC:1.1131 Sat Feb 13 19:53:23 2016 +++ src/sys/arch/i386/conf/GENERIC Sat Mar 5 17:08:48 2016 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.1131 2016/02/13 19:53:23 riastradh Exp $ +# $NetBSD: GENERIC,v 1.1132 2016/03/05 17:08:48 riastradh Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/i386/conf/std.i386" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.1131 $" +#ident "GENERIC-$Revision: 1.1132 $" maxusers 64 # estimated number of users @@ -578,8 +578,8 @@ intelfb* at intelfbbus? radeon* at pci? dev ? function ? radeondrmkmsfb* at radeonfbbus? -nouveau* at pci? dev ? function ? -nouveaufb* at nouveaufbbus? +#nouveau* at pci? dev ? function ? +#nouveaufb* at nouveaufbbus? # DRMUMS drivers #viadrmums* at drm?
CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2
Module Name:src Committed By: skrll Date: Sat Mar 5 13:03:00 UTC 2016 Modified Files: src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.32.2.22 -r1.32.2.23 src/sys/external/bsd/dwc2/dwc2.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/external/bsd/dwc2/dwc2.c diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.22 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.23 --- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.22 Sat Mar 5 08:11:07 2016 +++ src/sys/external/bsd/dwc2/dwc2.c Sat Mar 5 13:03:00 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $ */ +/* $NetBSD: dwc2.c,v 1.32.2.23 2016/03/05 13:03:00 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.23 2016/03/05 13:03:00 skrll Exp $"); #include "opt_usb.h" @@ -1033,7 +1033,7 @@ dwc2_device_start(struct usbd_xfer *xfer /* Copy request packet to our DMA buffer */ memcpy(KERNADDR(&dpipe->req_dma, 0), req, sizeof(*req)); usb_syncmem(&dpipe->req_dma, 0, sizeof(*req), - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREWRITE); len = UGETW(req->wLength); if ((req->bmRequestType & UT_READ) == UT_READ) { dir = UE_DIR_IN; @@ -1054,7 +1054,7 @@ dwc2_device_start(struct usbd_xfer *xfer dwc2_urb = dxfer->urb; if (!dwc2_urb) - return USBD_NOMEM; + return USBD_NOMEM; KASSERT(dwc2_urb->packet_count == xfer->ux_nframes); memset(dwc2_urb, 0, sizeof(*dwc2_urb) + @@ -1064,7 +1064,7 @@ dwc2_device_start(struct usbd_xfer *xfer dwc2_urb->packet_count = xfer->ux_nframes; dwc2_hcd_urb_set_pipeinfo(hsotg, dwc2_urb, addr, epnum, xfertype, dir, - mps); + mps); if (xfertype == UE_CONTROL) { dwc2_urb->setup_usbdma = &dpipe->req_dma;
CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2
Module Name:src Committed By: skrll Date: Sat Mar 5 13:01:47 UTC 2016 Modified Files: src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2var.h Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.3.12.9 -r1.3.12.10 src/sys/external/bsd/dwc2/dwc2var.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/external/bsd/dwc2/dwc2var.h diff -u src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.9 src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.10 --- src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.9 Tue Mar 1 15:19:37 2016 +++ src/sys/external/bsd/dwc2/dwc2var.h Sat Mar 5 13:01:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2var.h,v 1.3.12.9 2016/03/01 15:19:37 skrll Exp $ */ +/* $NetBSD: dwc2var.h,v 1.3.12.10 2016/03/05 13:01:47 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ struct dwc2_qtd; struct dwc2_xfer { struct usbd_xfer xfer; /* Needs to be first */ - struct usb_task abort_task; + struct usb_task abort_task; struct dwc2_hcd_urb *urb;
CVS commit: src/bin/df
Module Name:src Committed By: kamil Date: Sat Mar 5 08:15:01 UTC 2016 Modified Files: src/bin/df: df.c Log Message: Correct display of df(1) with the -i parameter Now the "Mounted on" column should be aligned with /entries. Patch by Michal Mazurek. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/bin/df/df.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/df/df.c diff -u src/bin/df/df.c:1.91 src/bin/df/df.c:1.92 --- src/bin/df/df.c:1.91 Thu Nov 12 17:59:21 2015 +++ src/bin/df/df.c Sat Mar 5 08:15:01 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: df.c,v 1.91 2015/11/12 17:59:21 christos Exp $ */ +/* $NetBSD: df.c,v 1.92 2016/03/05 08:15:01 kamil Exp $ */ /* * Copyright (c) 1980, 1990, 1993, 1994 @@ -45,7 +45,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: df.c,v 1.91 2015/11/12 17:59:21 christos Exp $"); +__RCSID("$NetBSD: df.c,v 1.92 2016/03/05 08:15:01 kamil Exp $"); #endif #endif /* not lint */ @@ -499,7 +499,7 @@ prtstat(struct statvfs *sfsp, int maxwid if (iflag) { inodes = sfsp->f_files; used = inodes - sfsp->f_ffree; - (void)printf(" %8jd %8jd %3s%%", + (void)printf(" %8jd %8jd %4s%%", (intmax_t)used, (intmax_t)sfsp->f_ffree, inodes == 0 ? (used == 0 ? empty : full) : strspct(pb, sizeof(pb), used, inodes, 0));
CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2
Module Name:src Committed By: skrll Date: Sat Mar 5 08:11:07 UTC 2016 Modified Files: src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c Log Message: Fix a KASSERT. I've managed to record via uaudia(4) on Raspberry PI now. To generate a diff of this commit: cvs rdiff -u -r1.32.2.21 -r1.32.2.22 src/sys/external/bsd/dwc2/dwc2.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/external/bsd/dwc2/dwc2.c diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.21 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.22 --- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.21 Fri Mar 4 15:30:17 2016 +++ src/sys/external/bsd/dwc2/dwc2.c Sat Mar 5 08:11:07 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $ */ +/* $NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $"); #include "opt_usb.h" @@ -1129,7 +1129,7 @@ dwc2_device_start(struct usbd_xfer *xfer xfer->ux_actlen = 0; KASSERT(xfertype != UE_ISOCHRONOUS || - xfer->ux_nframes < dwc2_urb->packet_count); + xfer->ux_nframes <= dwc2_urb->packet_count); KASSERTMSG(xfer->ux_nframes == 0 || xfertype == UE_ISOCHRONOUS, "nframes %d xfertype %d\n", xfer->ux_nframes, xfertype);