From owner-svn-src-stable-10@freebsd.org Sun Jan 8 08:52:54 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86F8ACA5E5C; Sun, 8 Jan 2017 08:52:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3380712B1; Sun, 8 Jan 2017 08:52:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v088qrRN082654; Sun, 8 Jan 2017 08:52:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v088qrfF082653; Sun, 8 Jan 2017 08:52:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701080852.v088qrfF082653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Jan 2017 08:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311673 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 08:52:54 -0000 Author: mav Date: Sun Jan 8 08:52:53 2017 New Revision: 311673 URL: https://svnweb.freebsd.org/changeset/base/311673 Log: MFC r311446: Fix bootverbose affecting code logic in r294558. Reported by: Jilles Tjoelker Modified: stable/10/sys/cam/ctl/ctl_ha.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_ha.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:16 2017 (r311672) +++ stable/10/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:53 2017 (r311673) @@ -443,8 +443,9 @@ ctl_ha_connect(struct ha_softc *softc) memcpy(&sa, &softc->ha_peer_in, sizeof(sa)); error = soconnect(so, (struct sockaddr *)&sa, td); - if (error != 0 && bootverbose) { - printf("%s: soconnect() error %d\n", __func__, error); + if (error != 0) { + if (bootverbose) + printf("%s: soconnect() error %d\n", __func__, error); goto out; } return (0); From owner-svn-src-stable-10@freebsd.org Sun Jan 8 16:59:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDD28CA5F45; Sun, 8 Jan 2017 16:59:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7951512; Sun, 8 Jan 2017 16:59:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v08Gx7eS077382; Sun, 8 Jan 2017 16:59:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v08Gx7kj077381; Sun, 8 Jan 2017 16:59:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701081659.v08Gx7kj077381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Jan 2017 16:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311687 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 16:59:09 -0000 Author: kib Date: Sun Jan 8 16:59:07 2017 New Revision: 311687 URL: https://svnweb.freebsd.org/changeset/base/311687 Log: MFC r267546 (by alc): Tidy up the early parts of vm_map_insert(). MFC r267645 (by alc): When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the corresponding flag(s) in the new map entry. Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when extending the stack in the downward direction. MFC r267850 (by alc): Place the check that blocks map entry coalescing on stack entries in vm_map_simplify_entry(). MFC r267917 (by alc): Delay the call to crhold() in vm_map_insert() until we know that we won't have to undo it by calling crfree(). Eliminate an unnecessary variable from vm_map_insert(). MFC r311014: Style fixes for vm_map_insert(). Tested by: pho Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sun Jan 8 16:55:59 2017 (r311686) +++ stable/10/sys/vm/vm_map.c Sun Jan 8 16:59:07 2017 (r311687) @@ -1130,24 +1130,24 @@ vm_map_lookup_entry( */ int vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, - vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, - int cow) + vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry; - vm_map_entry_t prev_entry; - vm_map_entry_t temp_entry; - vm_eflags_t protoeflags; + vm_map_entry_t new_entry, prev_entry, temp_entry; struct ucred *cred; + vm_eflags_t protoeflags; vm_inherit_t inheritance; - boolean_t charge_prev_obj; VM_MAP_ASSERT_LOCKED(map); + KASSERT((object != kmem_object && object != kernel_object) || + (cow & MAP_COPY_ON_WRITE) == 0, + ("vm_map_insert: kmem or kernel object and COW")); + KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0, + ("vm_map_insert: paradoxical MAP_NOFAULT request")); /* * Check that the start and end points are not bogus. */ - if ((start < map->min_offset) || (end > map->max_offset) || - (start >= end)) + if (start < map->min_offset || end > map->max_offset || start >= end) return (KERN_INVALID_ADDRESS); /* @@ -1162,26 +1162,22 @@ vm_map_insert(vm_map_t map, vm_object_t /* * Assert that the next entry doesn't overlap the end point. */ - if ((prev_entry->next != &map->header) && - (prev_entry->next->start < end)) + if (prev_entry->next != &map->header && prev_entry->next->start < end) return (KERN_NO_SPACE); protoeflags = 0; - charge_prev_obj = FALSE; - if (cow & MAP_COPY_ON_WRITE) - protoeflags |= MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY; - - if (cow & MAP_NOFAULT) { + protoeflags |= MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY; + if (cow & MAP_NOFAULT) protoeflags |= MAP_ENTRY_NOFAULT; - - KASSERT(object == NULL, - ("vm_map_insert: paradoxical MAP_NOFAULT request")); - } if (cow & MAP_DISABLE_SYNCER) protoeflags |= MAP_ENTRY_NOSYNC; if (cow & MAP_DISABLE_COREDUMP) protoeflags |= MAP_ENTRY_NOCOREDUMP; + if (cow & MAP_STACK_GROWS_DOWN) + protoeflags |= MAP_ENTRY_GROWS_DOWN; + if (cow & MAP_STACK_GROWS_UP) + protoeflags |= MAP_ENTRY_GROWS_UP; if (cow & MAP_VN_WRITECOUNT) protoeflags |= MAP_ENTRY_VN_WRITECNT; if (cow & MAP_INHERIT_SHARE) @@ -1190,23 +1186,17 @@ vm_map_insert(vm_map_t map, vm_object_t inheritance = VM_INHERIT_DEFAULT; cred = NULL; - KASSERT((object != kmem_object && object != kernel_object) || - ((object == kmem_object || object == kernel_object) && - !(protoeflags & MAP_ENTRY_NEEDS_COPY)), - ("kmem or kernel object and cow")); if (cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT)) goto charged; if ((cow & MAP_ACC_CHARGED) || ((prot & VM_PROT_WRITE) && ((protoeflags & MAP_ENTRY_NEEDS_COPY) || object == NULL))) { if (!(cow & MAP_ACC_CHARGED) && !swap_reserve(end - start)) return (KERN_RESOURCE_SHORTAGE); - KASSERT(object == NULL || (protoeflags & MAP_ENTRY_NEEDS_COPY) || + KASSERT(object == NULL || + (protoeflags & MAP_ENTRY_NEEDS_COPY) != 0 || object->cred == NULL, - ("OVERCOMMIT: vm_map_insert o %p", object)); + ("overcommit: vm_map_insert o %p", object)); cred = curthread->td_ucred; - crhold(cred); - if (object == NULL && !(protoeflags & MAP_ENTRY_NEEDS_COPY)) - charge_prev_obj = TRUE; } charged: @@ -1225,33 +1215,30 @@ charged: if (object->ref_count > 1 || object->shadow_count != 0) vm_object_clear_flag(object, OBJ_ONEMAPPING); VM_OBJECT_WUNLOCK(object); - } - else if ((prev_entry != &map->header) && - (prev_entry->eflags == protoeflags) && - (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && - (prev_entry->end == start) && - (prev_entry->wired_count == 0) && - (prev_entry->cred == cred || - (prev_entry->object.vm_object != NULL && - (prev_entry->object.vm_object->cred == cred))) && - vm_object_coalesce(prev_entry->object.vm_object, - prev_entry->offset, - (vm_size_t)(prev_entry->end - prev_entry->start), - (vm_size_t)(end - prev_entry->end), charge_prev_obj)) { + } else if (prev_entry != &map->header && + prev_entry->eflags == protoeflags && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && + prev_entry->end == start && prev_entry->wired_count == 0 && + (prev_entry->cred == cred || + (prev_entry->object.vm_object != NULL && + prev_entry->object.vm_object->cred == cred)) && + vm_object_coalesce(prev_entry->object.vm_object, + prev_entry->offset, + (vm_size_t)(prev_entry->end - prev_entry->start), + (vm_size_t)(end - prev_entry->end), cred != NULL && + (protoeflags & MAP_ENTRY_NEEDS_COPY) == 0)) { /* * We were able to extend the object. Determine if we * can extend the previous map entry to include the * new range as well. */ - if ((prev_entry->inheritance == inheritance) && - (prev_entry->protection == prot) && - (prev_entry->max_protection == max)) { - map->size += (end - prev_entry->end); + if (prev_entry->inheritance == inheritance && + prev_entry->protection == prot && + prev_entry->max_protection == max) { + map->size += end - prev_entry->end; prev_entry->end = end; vm_map_entry_resize_free(map, prev_entry); vm_map_simplify_entry(map, prev_entry); - if (cred != NULL) - crfree(cred); return (KERN_SUCCESS); } @@ -1263,21 +1250,16 @@ charged: */ object = prev_entry->object.vm_object; offset = prev_entry->offset + - (prev_entry->end - prev_entry->start); + (prev_entry->end - prev_entry->start); vm_object_reference(object); if (cred != NULL && object != NULL && object->cred != NULL && !(prev_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { /* Object already accounts for this uid. */ - crfree(cred); cred = NULL; } } - - /* - * NOTE: if conditionals fail, object can be NULL here. This occurs - * in things like the buffer map where we manage kva but do not manage - * backing objects. - */ + if (cred != NULL) + crhold(cred); /* * Create a new entry @@ -1301,7 +1283,7 @@ charged: new_entry->next_read = OFF_TO_IDX(offset); KASSERT(cred == NULL || !ENTRY_CHARGED(new_entry), - ("OVERCOMMIT: vm_map_insert leaks vm_map %p", new_entry)); + ("overcommit: vm_map_insert leaks vm_map %p", new_entry)); new_entry->cred = cred; /* @@ -1311,17 +1293,16 @@ charged: map->size += new_entry->end - new_entry->start; /* - * It may be possible to merge the new entry with the next and/or - * previous entries. However, due to MAP_STACK_* being a hack, a - * panic can result from merging such entries. - */ - if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0) - vm_map_simplify_entry(map, new_entry); - - if (cow & (MAP_PREFAULT|MAP_PREFAULT_PARTIAL)) { - vm_map_pmap_enter(map, start, prot, - object, OFF_TO_IDX(offset), end - start, - cow & MAP_PREFAULT_PARTIAL); + * Try to coalesce the new entry with both the previous and next + * entries in the list. Previously, we only attempted to coalesce + * with the previous entry when object is NULL. Here, we handle the + * other cases, which are less common. + */ + vm_map_simplify_entry(map, new_entry); + + if ((cow & (MAP_PREFAULT | MAP_PREFAULT_PARTIAL)) != 0) { + vm_map_pmap_enter(map, start, prot, object, OFF_TO_IDX(offset), + end - start, cow & MAP_PREFAULT_PARTIAL); } return (KERN_SUCCESS); @@ -1531,7 +1512,8 @@ vm_map_simplify_entry(vm_map_t map, vm_m vm_map_entry_t next, prev; vm_size_t prevsize, esize; - if (entry->eflags & (MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) + if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | + MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0) return; prev = entry->prev; @@ -3527,17 +3509,17 @@ vm_map_stack_locked(vm_map_t map, vm_off /* Now set the avail_ssize amount. */ if (rv == KERN_SUCCESS) { - if (prev_entry != &map->header) - vm_map_clip_end(map, prev_entry, bot); new_entry = prev_entry->next; if (new_entry->end != top || new_entry->start != bot) panic("Bad entry start/end for new stack entry"); new_entry->avail_ssize = max_ssize - init_ssize; - if (orient & MAP_STACK_GROWS_DOWN) - new_entry->eflags |= MAP_ENTRY_GROWS_DOWN; - if (orient & MAP_STACK_GROWS_UP) - new_entry->eflags |= MAP_ENTRY_GROWS_UP; + KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != 0, + ("new entry lacks MAP_ENTRY_GROWS_DOWN")); + KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, + ("new entry lacks MAP_ENTRY_GROWS_UP")); } return (rv); @@ -3764,21 +3746,21 @@ Retry: } rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, - next_entry->protection, next_entry->max_protection, 0); + next_entry->protection, next_entry->max_protection, + MAP_STACK_GROWS_DOWN); /* Adjust the available stack space by the amount we grew. */ if (rv == KERN_SUCCESS) { - if (prev_entry != &map->header) - vm_map_clip_end(map, prev_entry, addr); new_entry = prev_entry->next; KASSERT(new_entry == stack_entry->prev, ("foo")); KASSERT(new_entry->end == stack_entry->start, ("foo")); KASSERT(new_entry->start == addr, ("foo")); + KASSERT((new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != + 0, ("new entry lacks MAP_ENTRY_GROWS_DOWN")); grow_amount = new_entry->end - new_entry->start; new_entry->avail_ssize = stack_entry->avail_ssize - grow_amount; stack_entry->eflags &= ~MAP_ENTRY_GROWS_DOWN; - new_entry->eflags |= MAP_ENTRY_GROWS_DOWN; } } else { /* From owner-svn-src-stable-10@freebsd.org Mon Jan 9 00:09:21 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B32CA68A7; Mon, 9 Jan 2017 00:09:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1887E1A44; Mon, 9 Jan 2017 00:09:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0909K2c058813; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0909K4k058809; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701090009.v0909K4k058809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Jan 2017 00:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311708 - in stable: 10/sys/sys 10/usr.bin/kdump 11/sys/sys 11/usr.bin/kdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:09:21 -0000 Author: jhb Date: Mon Jan 9 00:09:19 2017 New Revision: 311708 URL: https://svnweb.freebsd.org/changeset/base/311708 Log: MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined. The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno. Modified: stable/10/sys/sys/errno.h stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/sys/errno.h stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/sys/errno.h ============================================================================== --- stable/10/sys/sys/errno.h Sun Jan 8 23:41:17 2017 (r311707) +++ stable/10/sys/sys/errno.h Mon Jan 9 00:09:19 2017 (r311708) @@ -184,7 +184,7 @@ __END_DECLS #define ELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ #define EJUSTRETURN (-2) /* don't modify regs, just return */ Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Sun Jan 8 23:41:17 2017 (r311707) +++ stable/10/usr.bin/kdump/kdump.c Mon Jan 9 00:09:19 2017 (r311708) @@ -41,10 +41,7 @@ static char sccsid[] = "@(#)kdump.c 8.1 #include __FBSDID("$FreeBSD$"); -#define _KERNEL -extern int errno; -#include -#undef _KERNEL +#define _WANT_KERNEL_ERRNO #include #include #include From owner-svn-src-stable-10@freebsd.org Mon Jan 9 01:05:03 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3C26CA51D9; Mon, 9 Jan 2017 01:05:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50FD71094; Mon, 9 Jan 2017 01:05:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09152Ea085086; Mon, 9 Jan 2017 01:05:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09152hO085085; Mon, 9 Jan 2017 01:05:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090105.v09152hO085085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311718 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:05:03 -0000 Author: ngie Date: Mon Jan 9 01:05:02 2017 New Revision: 311718 URL: https://svnweb.freebsd.org/changeset/base/311718 Log: MFC r310984,r311102: r310984: Use calloc instead of malloc + memset(.., 0, ..) r311102 (by pfg): Cleanup inelegant calloc(3) introduced in r310984. Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Mon Jan 9 01:02:16 2017 (r311717) +++ stable/10/lib/libc/net/getaddrinfo.c Mon Jan 9 01:05:02 2017 (r311718) @@ -673,9 +673,8 @@ reorder(struct addrinfo *sentinel) return(n); /* allocate a temporary array for sort and initialization of it. */ - if ((aio = malloc(sizeof(*aio) * n)) == NULL) + if ((aio = calloc(n, sizeof(*aio))) == NULL) return(n); /* give up reordering */ - memset(aio, 0, sizeof(*aio) * n); /* retrieve address selection policy from the kernel */ TAILQ_INIT(&policyhead); @@ -1454,9 +1453,8 @@ copy_ai(const struct addrinfo *pai) size_t l; l = sizeof(*ai) + pai->ai_addrlen; - if ((ai = (struct addrinfo *)malloc(l)) == NULL) + if ((ai = calloc(1, l)) == NULL) return NULL; - memset(ai, 0, l); memcpy(ai, pai, sizeof(*ai)); ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); @@ -1876,8 +1874,7 @@ addrinfo_unmarshal_func(char *buffer, si size = new_ai.ai_addrlen + sizeof(struct addrinfo) + _ALIGNBYTES; - sentinel = (struct addrinfo *)malloc(size); - memset(sentinel, 0, size); + sentinel = calloc(1, size); memcpy(sentinel, &new_ai, sizeof(struct addrinfo)); sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel + @@ -1890,8 +1887,7 @@ addrinfo_unmarshal_func(char *buffer, si memcpy(&size, p, sizeof(size_t)); p += sizeof(size_t); - sentinel->ai_canonname = (char *)malloc(size + 1); - memset(sentinel->ai_canonname, 0, size + 1); + sentinel->ai_canonname = calloc(1, size + 1); memcpy(sentinel->ai_canonname, p, size); p += size; From owner-svn-src-stable-10@freebsd.org Mon Jan 9 01:07:17 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8154CA52EF; Mon, 9 Jan 2017 01:07:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7E201383; Mon, 9 Jan 2017 01:07:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0917G3K085266; Mon, 9 Jan 2017 01:07:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0917GwG085265; Mon, 9 Jan 2017 01:07:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090107.v0917GwG085265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311720 - stable/10/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:07:18 -0000 Author: ngie Date: Mon Jan 9 01:07:16 2017 New Revision: 311720 URL: https://svnweb.freebsd.org/changeset/base/311720 Log: MFC r311393: OS_getSystemUptime: use nitems for calculating the number of elements in a sysctl mib instead of hardcoding the number 2 Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Mon Jan 9 01:05:44 2017 (r311719) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Mon Jan 9 01:07:16 2017 (r311720) @@ -33,7 +33,7 @@ * Host Resources MIB scalars implementation for SNMPd. */ -#include +#include #include #include @@ -85,7 +85,7 @@ OS_getSystemUptime(uint32_t *ut) int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t len = sizeof(kernel_boot_timestamp); - if (sysctl(mib, 2, &kernel_boot_timestamp, + if (sysctl(mib, nitems(mib), &kernel_boot_timestamp, &len, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl KERN_BOOTTIME failed: %m"); return (SNMP_ERR_GENERR); From owner-svn-src-stable-10@freebsd.org Mon Jan 9 01:08:44 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0F4BCA53AE; Mon, 9 Jan 2017 01:08:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D69C1568; Mon, 9 Jan 2017 01:08:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0918hYw085395; Mon, 9 Jan 2017 01:08:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0918hb4085394; Mon, 9 Jan 2017 01:08:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090108.v0918hb4085394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311721 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:08:44 -0000 Author: ngie Date: Mon Jan 9 01:08:43 2017 New Revision: 311721 URL: https://svnweb.freebsd.org/changeset/base/311721 Log: MFC r311382: Use calloc instead of malloc + memset(.., 0, ..) Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:07:16 2017 (r311720) +++ stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:08:43 2017 (r311721) @@ -143,16 +143,14 @@ lsock_open_port(u_char *name, size_t nam return (SNMP_ERR_BADVALUE); } - if ((port = malloc(sizeof(*port))) == NULL) + if ((port = calloc(1, sizeof(*port))) == NULL) return (SNMP_ERR_GENERR); - memset(port, 0, sizeof(*port)); if (!is_stream) { - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { free(port); return (SNMP_ERR_GENERR); } - memset(peer, 0, sizeof(*peer)); } if ((port->name = malloc(namelen + 1)) == NULL) { free(port); @@ -258,12 +256,11 @@ lsock_listen_input(int fd, void *udata) struct lsock_port *p = udata; struct lsock_peer *peer; - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { syslog(LOG_WARNING, "%s: peer malloc failed", p->name); (void)close(accept(fd, NULL, NULL)); return; } - memset(peer, 0, sizeof(*peer)); peer->port = p; From owner-svn-src-stable-10@freebsd.org Mon Jan 9 01:11:39 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA141CA5853; Mon, 9 Jan 2017 01:11:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD271B09; Mon, 9 Jan 2017 01:11:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v091Bcd1089331; Mon, 9 Jan 2017 01:11:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091Bc5n089330; Mon, 9 Jan 2017 01:11:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090111.v091Bc5n089330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311723 - stable/10/contrib/bsnmp/snmp_usm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:11:39 -0000 Author: ngie Date: Mon Jan 9 01:11:38 2017 New Revision: 311723 URL: https://svnweb.freebsd.org/changeset/base/311723 Log: MFC r311384: op_usm_users: fix indentation in SNMP_OP_SET block Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:09:00 2017 (r311722) +++ stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:11:38 2017 (r311723) @@ -167,7 +167,7 @@ op_usm_users(struct snmp_context *ctx, s if ((uuser = usm_get_user(&val->var, sub)) == NULL && val->var.subs[sub - 1] != LEAF_usmUserStatus && val->var.subs[sub - 1] != LEAF_usmUserCloneFrom) - return (SNMP_ERR_NOSUCHNAME); + return (SNMP_ERR_NOSUCHNAME); if (community != COMM_INITIALIZE && uuser->type == StorageType_readOnly) From owner-svn-src-stable-10@freebsd.org Mon Jan 9 01:12:34 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18ED1CA5953; Mon, 9 Jan 2017 01:12:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBAC91E8F; Mon, 9 Jan 2017 01:12:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v091CW46089492; Mon, 9 Jan 2017 01:12:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091CWnQ089491; Mon, 9 Jan 2017 01:12:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090112.v091CWnQ089491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311725 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:12:34 -0000 Author: ngie Date: Mon Jan 9 01:12:32 2017 New Revision: 311725 URL: https://svnweb.freebsd.org/changeset/base/311725 Log: MFC r311505: Remove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:11:42 2017 (r311724) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:12:32 2017 (r311725) @@ -37,7 +37,7 @@ * Scalars */ int -op_begemot_mibII(struct snmp_context *ctx __unused, struct snmp_value *value, +op_begemot_mibII(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { switch (op) { From owner-svn-src-stable-10@freebsd.org Mon Jan 9 01:29:21 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3014CA5ED4; Mon, 9 Jan 2017 01:29:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FEC9190B; Mon, 9 Jan 2017 01:29:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v091TKuC094136; Mon, 9 Jan 2017 01:29:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091TK8V094134; Mon, 9 Jan 2017 01:29:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090129.v091TK8V094134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311729 - in stable/10/kerberos5: . lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:29:21 -0000 Author: ngie Date: Mon Jan 9 01:29:20 2017 New Revision: 311729 URL: https://svnweb.freebsd.org/changeset/base/311729 Log: MFC r311112,r311115: r311112: libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize their building on the knob r311115: Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS if MK_GSSAPI != "no" Modified: stable/10/kerberos5/Makefile.inc stable/10/kerberos5/lib/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/Makefile.inc ============================================================================== --- stable/10/kerberos5/Makefile.inc Mon Jan 9 01:22:46 2017 (r311728) +++ stable/10/kerberos5/Makefile.inc Mon Jan 9 01:29:20 2017 (r311729) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + NO_LINT= KRB5DIR= ${.CURDIR}/../../../crypto/heimdal @@ -27,11 +29,14 @@ ETSRCS= \ ${KRB5DIR}/lib/krb5/k524_err.et \ ${KRB5DIR}/lib/krb5/krb5_err.et \ ${KRB5DIR}/lib/krb5/krb_err.et \ - ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et \ ${KRB5DIR}/lib/hx509/hx509_err.et \ ${KRB5DIR}/lib/wind/wind_err.et \ ${KRB5DIR}/lib/ntlm/ntlm_err.et +.if ${MK_GSSAPI} != "no" +ETSRCS+= ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et +.endif + .for ET in ${ETSRCS} .for _ET in ${ET:T:R} .if ${SRCS:M${_ET}.[ch]} != "" Modified: stable/10/kerberos5/lib/Makefile ============================================================================== --- stable/10/kerberos5/lib/Makefile Mon Jan 9 01:22:46 2017 (r311728) +++ stable/10/kerberos5/lib/Makefile Mon Jan 9 01:29:20 2017 (r311729) @@ -1,10 +1,17 @@ - # $FreeBSD$ -SUBDIR= libasn1 libgssapi_krb5 libgssapi_ntlm libgssapi_spnego libhdb \ +.include + +SUBDIR= libasn1 libhdb \ libheimntlm libhx509 libkadm5clnt libkadm5srv libkafs5 libkrb5 \ libroken libsl libvers libkdc libwind libheimsqlite libheimbase libheimipcc libheimipcs SUBDIR_DEPEND_libkafs5= libkrb5 +.if ${MK_GSSAPI} != "no" +SUBDIR+= libgssapi_krb5 +SUBDIR+= libgssapi_ntlm +SUBDIR+= libgssapi_spnego +.endif + .include From owner-svn-src-stable-10@freebsd.org Mon Jan 9 01:31:14 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FF2CA5F67; Mon, 9 Jan 2017 01:31:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDD931B02; Mon, 9 Jan 2017 01:31:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v091VDkK094306; Mon, 9 Jan 2017 01:31:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v091VD3q094305; Mon, 9 Jan 2017 01:31:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090131.v091VD3q094305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 01:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311730 - stable/10/kerberos5/libexec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 01:31:14 -0000 Author: ngie Date: Mon Jan 9 01:31:12 2017 New Revision: 311730 URL: https://svnweb.freebsd.org/changeset/base/311730 Log: MFC r311114: Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi Modified: stable/10/kerberos5/libexec/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/libexec/Makefile ============================================================================== --- stable/10/kerberos5/libexec/Makefile Mon Jan 9 01:29:20 2017 (r311729) +++ stable/10/kerberos5/libexec/Makefile Mon Jan 9 01:31:12 2017 (r311730) @@ -1,7 +1,13 @@ # $FreeBSD$ -SUBDIR= digest-service ipropd-master ipropd-slave hprop hpropd kadmind kdc \ +.include + +SUBDIR= digest-service ipropd-master ipropd-slave hprop hpropd kdc \ kdigest kfd kimpersonate kpasswdd kcm SUBDIR_PARALLEL= +.if ${MK_GSSAPI} != "no" +SUBDIR+= kadmind +.endif + .include From owner-svn-src-stable-10@freebsd.org Mon Jan 9 05:44:20 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8821ACA5561; Mon, 9 Jan 2017 05:44:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 573DA1C37; Mon, 9 Jan 2017 05:44:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v095iJDf099583; Mon, 9 Jan 2017 05:44:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095iJKF099582; Mon, 9 Jan 2017 05:44:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090544.v095iJKF099582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311747 - stable/10/libexec/talkd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:44:20 -0000 Author: delphij Date: Mon Jan 9 05:44:19 2017 New Revision: 311747 URL: https://svnweb.freebsd.org/changeset/base/311747 Log: MFC r310608: Avoid use after free. Modified: stable/10/libexec/talkd/table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/talkd/table.c ============================================================================== --- stable/10/libexec/talkd/table.c Mon Jan 9 05:41:47 2017 (r311746) +++ stable/10/libexec/talkd/table.c Mon Jan 9 05:44:19 2017 (r311747) @@ -82,14 +82,15 @@ static TABLE_ENTRY *table = NIL; CTL_MSG * find_match(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); current_time = tp.tv_sec; if (debug) print_request("find_match", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) @@ -115,7 +116,7 @@ find_match(CTL_MSG *request) CTL_MSG * find_request(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); @@ -126,7 +127,8 @@ find_request(CTL_MSG *request) */ if (debug) print_request("find_request", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) From owner-svn-src-stable-10@freebsd.org Mon Jan 9 05:52:31 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6953CA58AA; Mon, 9 Jan 2017 05:52:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75C4C1579; Mon, 9 Jan 2017 05:52:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v095qUjv003892; Mon, 9 Jan 2017 05:52:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095qUUA003891; Mon, 9 Jan 2017 05:52:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090552.v095qUUA003891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311751 - stable/10/libexec/talkd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:52:31 -0000 Author: delphij Date: Mon Jan 9 05:52:30 2017 New Revision: 311751 URL: https://svnweb.freebsd.org/changeset/base/311751 Log: MFC r310609: Don't use high precision clock for expiration as only second portion is used. Modified: stable/10/libexec/talkd/table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/talkd/table.c ============================================================================== --- stable/10/libexec/talkd/table.c Mon Jan 9 05:51:38 2017 (r311750) +++ stable/10/libexec/talkd/table.c Mon Jan 9 05:52:30 2017 (r311751) @@ -60,7 +60,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -static struct timeval tp; +static struct timespec ts; typedef struct table_entry TABLE_ENTRY; @@ -85,8 +85,8 @@ find_match(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; if (debug) print_request("find_match", request); for (ptr = table; ptr != NIL; ptr = next) { @@ -119,8 +119,8 @@ find_request(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; /* * See if this is a repeated message, and check for * out of date entries in the table while we are it. @@ -157,8 +157,8 @@ insert_table(CTL_MSG *request, CTL_RESPO TABLE_ENTRY *ptr; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; request->id_num = new_id(); response->id_num = htonl(request->id_num); /* insert a new entry into the top of the list */ From owner-svn-src-stable-10@freebsd.org Mon Jan 9 05:58:49 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8D5ECA5A82; Mon, 9 Jan 2017 05:58:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B78091971; Mon, 9 Jan 2017 05:58:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v095wm0p004330; Mon, 9 Jan 2017 05:58:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095wmEg004329; Mon, 9 Jan 2017 05:58:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090558.v095wmEg004329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311753 - stable/10/usr.sbin/pstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:58:50 -0000 Author: delphij Date: Mon Jan 9 05:58:48 2017 New Revision: 311753 URL: https://svnweb.freebsd.org/changeset/base/311753 Log: MFC r310611: - pstat(8) does not accept any arguments other than getopt() args, so don't bother to adjust argc/argv after getopt() loop. - Make a string pointer constant. Modified: stable/10/usr.sbin/pstat/pstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pstat/pstat.c ============================================================================== --- stable/10/usr.sbin/pstat/pstat.c Mon Jan 9 05:57:31 2017 (r311752) +++ stable/10/usr.sbin/pstat/pstat.c Mon Jan 9 05:58:48 2017 (r311753) @@ -174,8 +174,6 @@ main(int argc, char *argv[]) default: usage(); } - argc -= optind; - argv += optind; /* * Initialize symbol names list. @@ -339,7 +337,7 @@ static void ttyprt(struct xtty *xt) { int i, j; - char *name; + const char *name; if (xt->xt_size != sizeof *xt) errx(1, "struct xtty size mismatch"); From owner-svn-src-stable-10@freebsd.org Mon Jan 9 06:07:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E89BDCA5EB8; Mon, 9 Jan 2017 06:07:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA2CF1244; Mon, 9 Jan 2017 06:07:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0967i2L008668; Mon, 9 Jan 2017 06:07:44 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0967iZD008667; Mon, 9 Jan 2017 06:07:44 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090607.v0967iZD008667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 06:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311756 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:07:46 -0000 Author: delphij Date: Mon Jan 9 06:07:44 2017 New Revision: 311756 URL: https://svnweb.freebsd.org/changeset/base/311756 Log: MFC r310614: Don't assign rtjp twice. Modified: stable/10/usr.sbin/jail/jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.c ============================================================================== --- stable/10/usr.sbin/jail/jail.c Mon Jan 9 06:05:57 2017 (r311755) +++ stable/10/usr.sbin/jail/jail.c Mon Jan 9 06:07:44 2017 (r311756) @@ -806,8 +806,7 @@ rdtun_params(struct cfjail *j, int dofai if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { rtjp = rtparams + 1; - for (jp = j->jp, rtjp = rtparams + 1; rtjp < rtparams + nrt; - jp++) { + for (jp = j->jp; rtjp < rtparams + nrt; jp++) { if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && jp->jp_valuelen == 0 && From owner-svn-src-stable-10@freebsd.org Mon Jan 9 08:10:14 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 025C0CA65AB; Mon, 9 Jan 2017 08:10:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8175196E; Mon, 9 Jan 2017 08:10:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v098ADOQ057894; Mon, 9 Jan 2017 08:10:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v098ADoT057893; Mon, 9 Jan 2017 08:10:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090810.v098ADoT057893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311766 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:10:14 -0000 Author: arybchik Date: Mon Jan 9 08:10:12 2017 New Revision: 311766 URL: https://svnweb.freebsd.org/changeset/base/311766 Log: MFC r311638 sfxge(4): use SFXGE_LINK_UP() to report link up state Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Mon Jan 9 08:07:18 2017 (r311765) +++ stable/10/sys/dev/sfxge/sfxge_port.c Mon Jan 9 08:10:12 2017 (r311766) @@ -284,8 +284,7 @@ sfxge_mac_link_update(struct sfxge_softc port->link_mode = mode; /* Push link state update to the OS */ - link_state = (port->link_mode != EFX_LINK_DOWN ? - LINK_STATE_UP : LINK_STATE_DOWN); + link_state = (SFXGE_LINK_UP(sc) ? LINK_STATE_UP : LINK_STATE_DOWN); if_initbaudrate(sc->ifnet, sfxge_link_baudrate[port->link_mode]); if_link_state_change(sc->ifnet, link_state); } From owner-svn-src-stable-10@freebsd.org Mon Jan 9 08:11:18 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14BA4CA6762; Mon, 9 Jan 2017 08:11:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D50311B6F; Mon, 9 Jan 2017 08:11:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v098BG63060820; Mon, 9 Jan 2017 08:11:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v098BGA7060819; Mon, 9 Jan 2017 08:11:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090811.v098BGA7060819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311767 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:11:18 -0000 Author: arybchik Date: Mon Jan 9 08:11:16 2017 New Revision: 311767 URL: https://svnweb.freebsd.org/changeset/base/311767 Log: MFC r311639 sfxge(4): treat EFX_LINK_UNKOWN as link down It is safer to consider EFX_LINK_UNKNOWN as link down. link_mode is set to EFX_LINK_UNKNOWN on port stop and fini. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Mon Jan 9 08:10:12 2017 (r311766) +++ stable/10/sys/dev/sfxge/sfxge.h Mon Jan 9 08:11:16 2017 (r311767) @@ -329,7 +329,9 @@ struct sfxge_softc { #endif }; -#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) +#define SFXGE_LINK_UP(sc) \ + ((sc)->port.link_mode != EFX_LINK_DOWN && \ + (sc)->port.link_mode != EFX_LINK_UNKNOWN) #define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) #define SFXGE_PARAM(_name) "hw.sfxge." #_name From owner-svn-src-stable-10@freebsd.org Mon Jan 9 08:12:24 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36EA8CA67ED; Mon, 9 Jan 2017 08:12:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 141641EBC; Mon, 9 Jan 2017 08:12:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v098CNkl061792; Mon, 9 Jan 2017 08:12:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v098CMgk061785; Mon, 9 Jan 2017 08:12:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701090812.v098CMgk061785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 Jan 2017 08:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311768 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 08:12:24 -0000 Author: arybchik Date: Mon Jan 9 08:12:22 2017 New Revision: 311768 URL: https://svnweb.freebsd.org/changeset/base/311768 Log: MFC r311640 sfxge(4): allow DMA descs to cross 4k boundary on EF10 Siena has limitation on maximum byte count and 4k boundary crosssing (which is stricter than maximum byte count). EF10 has limitation on maximum byte count only. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_tx.c stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/medford_nic.c stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_tx.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/ef10_tx.c Mon Jan 9 08:12:22 2017 (r311768) @@ -438,8 +438,9 @@ ef10_tx_qpost( size_t offset; efx_qword_t qword; - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= (addr + size)); + /* No limitations on boundary crossing */ + EFSYS_ASSERT(size <= + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); id = added++ & etp->et_mask; offset = id * sizeof (efx_qword_t); @@ -584,8 +585,8 @@ ef10_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size); + /* No limitations on boundary crossing */ + EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index, efsys_dma_addr_t, addr, Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/efx.h Mon Jan 9 08:12:22 2017 (r311768) @@ -1154,6 +1154,13 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_batch_max; /* Number of rx descriptors the hardware requires for a push. */ uint32_t enc_rx_push_align; + /* Maximum amount of data in DMA descriptor */ + uint32_t enc_tx_dma_desc_size_max; + /* + * Boundary which DMA descriptor data must not cross or 0 if no + * limitation. + */ + uint32_t enc_tx_dma_desc_boundary; /* * Maximum number of bytes into the packet the TCP header can start for * the hardware to apply TSO packet edits. Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Mon Jan 9 08:12:22 2017 (r311768) @@ -748,8 +748,12 @@ siena_tx_qpost( size_t size = ebp->eb_size; efsys_dma_addr_t end = start + size; - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(start + 1, 4096) >= end); + /* + * Fragments must not span 4k boundaries. + * Here it is a stricter requirement than the maximum length. + */ + EFSYS_ASSERT(P2ROUNDUP(start + 1, + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= end); EFX_TX_DESC(etp, start, size, ebp->eb_eop, added); } @@ -1009,8 +1013,12 @@ siena_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { - /* Fragments must not span 4k boundaries. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size); + /* + * Fragments must not span 4k boundaries. + * Here it is a stricter requirement than the maximum length. + */ + EFSYS_ASSERT(P2ROUNDUP(addr + 1, + etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= addr + size); EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index, efsys_dma_addr_t, addr, Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Mon Jan 9 08:12:22 2017 (r311768) @@ -304,6 +304,10 @@ hunt_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Mon Jan 9 08:12:22 2017 (r311768) @@ -301,6 +301,10 @@ medford_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Mon Jan 9 08:12:22 2017 (r311768) @@ -138,6 +138,10 @@ siena_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = 1; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(FSF_AZ_TX_KER_BYTE_COUNT); + /* Fragments must not span 4k boundaries. */ + encp->enc_tx_dma_desc_boundary = 4096; + /* Resource limits */ rc = efx_mcdi_get_resource_limits(enp, &nevq, &nrxq, &ntxq); if (rc != 0) { Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Mon Jan 9 08:11:16 2017 (r311767) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Mon Jan 9 08:12:22 2017 (r311768) @@ -1701,6 +1701,7 @@ static int sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) { + const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp); char name[16]; struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); struct sysctl_oid *txq_node; @@ -1731,9 +1732,11 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ - if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, + if (bus_dma_tag_create(sc->parent_dma_tag, 1, + encp->enc_tx_dma_desc_boundary, MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, - NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, + NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, + encp->enc_tx_dma_desc_size_max, 0, NULL, NULL, &txq->packet_dma_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); rc = ENOMEM; From owner-svn-src-stable-10@freebsd.org Mon Jan 9 10:13:54 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4935CA63A0; Mon, 9 Jan 2017 10:13:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8267C1A24; Mon, 9 Jan 2017 10:13:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09ADrUR011713; Mon, 9 Jan 2017 10:13:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09ADrsT011712; Mon, 9 Jan 2017 10:13:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091013.v09ADrsT011712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311772 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:13:54 -0000 Author: kib Date: Mon Jan 9 10:13:53 2017 New Revision: 311772 URL: https://svnweb.freebsd.org/changeset/base/311772 Log: MFC r311055: Remove unneeded externs keywords. Reindent long lines. Modified: stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Mon Jan 9 09:57:34 2017 (r311771) +++ stable/10/sys/sys/event.h Mon Jan 9 10:13:53 2017 (r311772) @@ -253,29 +253,29 @@ struct knlist; struct mtx; struct rwlock; -extern void knote(struct knlist *list, long hint, int lockflags); -extern void knote_fork(struct knlist *list, int pid); -extern void knlist_add(struct knlist *knl, struct knote *kn, int islocked); -extern void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); -extern void knlist_remove_inevent(struct knlist *knl, struct knote *kn); -extern int knlist_empty(struct knlist *knl); -extern void knlist_init(struct knlist *knl, void *lock, - void (*kl_lock)(void *), void (*kl_unlock)(void *), - void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *)); -extern void knlist_init_mtx(struct knlist *knl, struct mtx *lock); -extern void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); -extern void knlist_destroy(struct knlist *knl); -extern void knlist_cleardel(struct knlist *knl, struct thread *td, +void knote(struct knlist *list, long hint, int lockflags); +void knote_fork(struct knlist *list, int pid); +void knlist_add(struct knlist *knl, struct knote *kn, int islocked); +void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); +void knlist_remove_inevent(struct knlist *knl, struct knote *kn); +int knlist_empty(struct knlist *knl); +void knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), + void (*kl_unlock)(void *), void (*kl_assert_locked)(void *), + void (*kl_assert_unlocked)(void *)); +void knlist_init_mtx(struct knlist *knl, struct mtx *lock); +void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); +void knlist_destroy(struct knlist *knl); +void knlist_cleardel(struct knlist *knl, struct thread *td, int islocked, int killkn); #define knlist_clear(knl, islocked) \ - knlist_cleardel((knl), NULL, (islocked), 0) + knlist_cleardel((knl), NULL, (islocked), 0) #define knlist_delete(knl, td, islocked) \ - knlist_cleardel((knl), (td), (islocked), 1) -extern void knote_fdclose(struct thread *p, int fd); -extern int kqfd_register(int fd, struct kevent *kev, struct thread *p, - int waitok); -extern int kqueue_add_filteropts(int filt, struct filterops *filtops); -extern int kqueue_del_filteropts(int filt); + knlist_cleardel((knl), (td), (islocked), 1) +void knote_fdclose(struct thread *p, int fd); +int kqfd_register(int fd, struct kevent *kev, struct thread *p, + int waitok); +int kqueue_add_filteropts(int filt, struct filterops *filtops); +int kqueue_del_filteropts(int filt); #else /* !_KERNEL */ From owner-svn-src-stable-10@freebsd.org Mon Jan 9 10:18:35 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E52DACA657E; Mon, 9 Jan 2017 10:18:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E5F1D18; Mon, 9 Jan 2017 10:18:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09AIYlN011975; Mon, 9 Jan 2017 10:18:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AIYhh011974; Mon, 9 Jan 2017 10:18:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091018.v09AIYhh011974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311773 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:18:36 -0000 Author: kib Date: Mon Jan 9 10:18:34 2017 New Revision: 311773 URL: https://svnweb.freebsd.org/changeset/base/311773 Log: MFC r310615: Change knlist_destroy() to assertion. Modified: stable/10/sys/kern/kern_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Mon Jan 9 10:13:53 2017 (r311772) +++ stable/10/sys/kern/kern_event.c Mon Jan 9 10:18:34 2017 (r311773) @@ -2177,17 +2177,8 @@ void knlist_destroy(struct knlist *knl) { -#ifdef INVARIANTS - /* - * if we run across this error, we need to find the offending - * driver and have it call knlist_clear or knlist_delete. - */ - if (!SLIST_EMPTY(&knl->kl_list)) - printf("WARNING: destroying knlist w/ knotes on it!\n"); -#endif - - knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL; - SLIST_INIT(&knl->kl_list); + KASSERT(KNLIST_EMPTY(knl), + ("destroying knlist %p with knotes on it", knl)); } /* From owner-svn-src-stable-10@freebsd.org Mon Jan 9 10:29:14 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB55CA6BAC; Mon, 9 Jan 2017 10:29:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 441BD18CB; Mon, 9 Jan 2017 10:29:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09ATDTW016312; Mon, 9 Jan 2017 10:29:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09ATDEG016311; Mon, 9 Jan 2017 10:29:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091029.v09ATDEG016311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311777 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:29:14 -0000 Author: kib Date: Mon Jan 9 10:29:13 2017 New Revision: 311777 URL: https://svnweb.freebsd.org/changeset/base/311777 Log: MFC r311108: Move common code from kern_statfs() and kern_fstatfs() into a new helper. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:26:02 2017 (r311776) +++ stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:29:13 2017 (r311777) @@ -256,6 +256,45 @@ statfs_scale_blocks(struct statfs *sf, l sf->f_bavail >>= shift; } +static int +kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) +{ + struct statfs *sp, sb; + int error; + + if (mp == NULL) + return (EBADF); + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error != 0) + return (error); +#ifdef MAC + error = mac_mount_check_stat(td->td_ucred, mp); + if (error != 0) + goto out; +#endif + /* + * Set these in case the underlying filesystem fails to do so. + */ + sp = &mp->mnt_stat; + sp->f_version = STATFS_VERSION; + sp->f_namemax = NAME_MAX; + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + error = VFS_STATFS(mp, sp); + if (error != 0) + goto out; + if (priv_check(td, PRIV_VFS_GENERATION)) { + bcopy(sp, &sb, sizeof(sb)); + sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, &sb); + sp = &sb; + } + *buf = *sp; +out: + vfs_unbusy(mp); + return (error); +} + /* * Get filesystem statistics. */ @@ -287,7 +326,6 @@ kern_statfs(struct thread *td, char *pat struct statfs *buf) { struct mount *mp; - struct statfs *sp, sb; struct nameidata nd; int error; @@ -300,35 +338,7 @@ kern_statfs(struct thread *td, char *pat vfs_ref(mp); NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* - * Set these in case the underlying filesystem fails to do so. - */ - sp = &mp->mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; - } - *buf = *sp; -out: - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* @@ -362,7 +372,6 @@ kern_fstatfs(struct thread *td, int fd, { struct file *fp; struct mount *mp; - struct statfs *sp, sb; struct vnode *vp; cap_rights_t rights; int error; @@ -382,40 +391,7 @@ kern_fstatfs(struct thread *td, int fd, vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); - if (mp == NULL) { - error = EBADF; - goto out; - } - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* - * Set these in case the underlying filesystem fails to do so. - */ - sp = &mp->mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; - } - *buf = *sp; -out: - if (mp) - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* From owner-svn-src-stable-10@freebsd.org Mon Jan 9 10:30:25 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F52CCA6C3D; Mon, 9 Jan 2017 10:30:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B9731A39; Mon, 9 Jan 2017 10:30:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09AUO1O016426; Mon, 9 Jan 2017 10:30:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AUO1j016425; Mon, 9 Jan 2017 10:30:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091030.v09AUO1j016425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311778 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:30:25 -0000 Author: kib Date: Mon Jan 9 10:30:24 2017 New Revision: 311778 URL: https://svnweb.freebsd.org/changeset/base/311778 Log: MFC r311111: Style. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:29:13 2017 (r311777) +++ stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:30:24 2017 (r311778) @@ -387,7 +387,7 @@ kern_fstatfs(struct thread *td, int fd, AUDIT_ARG_VNODE1(vp); #endif mp = vp->v_mount; - if (mp) + if (mp != NULL) vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); From owner-svn-src-stable-10@freebsd.org Mon Jan 9 10:31:40 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAD5DCA6DD9; Mon, 9 Jan 2017 10:31:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C2761D91; Mon, 9 Jan 2017 10:31:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09AVdRA019329; Mon, 9 Jan 2017 10:31:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09AVdnu019328; Mon, 9 Jan 2017 10:31:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701091031.v09AVdnu019328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Jan 2017 10:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311779 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 10:31:40 -0000 Author: kib Date: Mon Jan 9 10:31:39 2017 New Revision: 311779 URL: https://svnweb.freebsd.org/changeset/base/311779 Log: MFC r311113: There is no need to use temporary statfs buffer for fsid obliteration and prison enforcement. Do it on the caller buffer directly. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:30:24 2017 (r311778) +++ stable/10/sys/kern/vfs_syscalls.c Mon Jan 9 10:31:39 2017 (r311779) @@ -259,7 +259,7 @@ statfs_scale_blocks(struct statfs *sf, l static int kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) { - struct statfs *sp, sb; + struct statfs *sp; int error; if (mp == NULL) @@ -283,13 +283,11 @@ kern_do_statfs(struct thread *td, struct error = VFS_STATFS(mp, sp); if (error != 0) goto out; + *buf = *sp; if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, &sb, sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, &sb); - sp = &sb; + buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, buf); } - *buf = *sp; out: vfs_unbusy(mp); return (error); From owner-svn-src-stable-10@freebsd.org Mon Jan 9 16:47:40 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F28E0CA7FAD; Mon, 9 Jan 2017 16:47:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3FD71325; Mon, 9 Jan 2017 16:47:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09GlegM074533; Mon, 9 Jan 2017 16:47:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09Glemt074532; Mon, 9 Jan 2017 16:47:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091647.v09Glemt074532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 16:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311789 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:47:41 -0000 Author: hselasky Date: Mon Jan 9 16:47:39 2017 New Revision: 311789 URL: https://svnweb.freebsd.org/changeset/base/311789 Log: MFC r310388: Make a read only pointer constant. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:45:08 2017 (r311788) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:47:39 2017 (r311789) @@ -314,7 +314,7 @@ mlx5e_update_pport_counters(struct mlx5e struct mlx5e_port_stats_debug *s_debug = &priv->stats.port_stats_debug; u32 *in; u32 *out; - u64 *ptr; + const u64 *ptr; unsigned sz = MLX5_ST_SZ_BYTES(ppcnt_reg); unsigned x; unsigned y; @@ -324,7 +324,7 @@ mlx5e_update_pport_counters(struct mlx5e if (in == NULL || out == NULL) goto free_out; - ptr = (uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); + ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); MLX5_SET(ppcnt_reg, in, local_port, 1); From owner-svn-src-stable-10@freebsd.org Mon Jan 9 16:55:30 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBDE3CA74E5; Mon, 9 Jan 2017 16:55:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A90CB1DAB; Mon, 9 Jan 2017 16:55:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09GtTUM078545; Mon, 9 Jan 2017 16:55:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09GtTuc078544; Mon, 9 Jan 2017 16:55:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091655.v09GtTuc078544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 16:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311791 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:55:30 -0000 Author: hselasky Date: Mon Jan 9 16:55:29 2017 New Revision: 311791 URL: https://svnweb.freebsd.org/changeset/base/311791 Log: MFC r310387: Add more comments regarding collection of statistics counters. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:52:35 2017 (r311790) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 9 16:55:29 2017 (r311791) @@ -306,6 +306,12 @@ mlx5e_update_carrier_work(struct work_st PRIV_UNLOCK(priv); } +/* + * This function reads the physical port counters from the firmware + * using a pre-defined layout defined by various MLX5E_PPORT_XXX() + * macros. The output is converted from big-endian 64-bit values into + * host endian ones and stored in the "priv->stats.pport" structure. + */ static void mlx5e_update_pport_counters(struct mlx5e_priv *priv) { @@ -319,20 +325,27 @@ mlx5e_update_pport_counters(struct mlx5e unsigned x; unsigned y; + /* allocate firmware request structures */ in = mlx5_vzalloc(sz); out = mlx5_vzalloc(sz); if (in == NULL || out == NULL) goto free_out; + /* + * Get pointer to the 64-bit counter set which is located at a + * fixed offset in the output firmware request structure: + */ ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set); MLX5_SET(ppcnt_reg, in, local_port, 1); + /* read IEEE802_3 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_IEEE_802_3_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = y = 0; x != MLX5E_PPORT_IEEE802_3_STATS_NUM; x++, y++) s->arg[y] = be64toh(ptr[x]); + /* read RFC2819 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2819_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_RFC2819_STATS_NUM; x++, y++) @@ -341,20 +354,29 @@ mlx5e_update_pport_counters(struct mlx5e MLX5E_PPORT_RFC2819_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read RFC2863 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2863_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_RFC2863_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read physical layer stats counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); free_out: + /* free firmware request structures */ kvfree(in); kvfree(out); } +/* + * This function is called regularly to collect all statistics + * counters from the firmware. The values can be viewed through the + * sysctl interface. Execution is serialized using the priv's global + * configuration lock. + */ static void mlx5e_update_stats_work(struct work_struct *work) { From owner-svn-src-stable-10@freebsd.org Mon Jan 9 17:07:55 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470F6CA7EB1; Mon, 9 Jan 2017 17:07:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA351F03; Mon, 9 Jan 2017 17:07:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09H7qdj083290; Mon, 9 Jan 2017 17:07:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09H7qr8083289; Mon, 9 Jan 2017 17:07:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091707.v09H7qr8083289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311795 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:07:55 -0000 Author: hselasky Date: Mon Jan 9 17:07:52 2017 New Revision: 311795 URL: https://svnweb.freebsd.org/changeset/base/311795 Log: MFC r310058: Fix initialisation of mlx4_pci_table's .driver_data fields. Differential Revision: https://reviews.freebsd.org/D8791 Sponsored by: Mellanox Technologies Submitted by: Dexuan Cui Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 17:07:13 2017 (r311794) +++ stable/10/sys/ofed/drivers/net/mlx4/main.c Mon Jan 9 17:07:52 2017 (r311795) @@ -3637,47 +3637,61 @@ int mlx4_restart_one(struct pci_dev *pde static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = { /* MT25408 "Hermon" SDR */ - { PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6340), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR */ - { PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x634a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR */ - { PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6354), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" DDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6732), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" QDR PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x673c), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6368), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6750), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6372), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ - { PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x675a), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/ - { PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6764), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */ - { PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x6746), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT26478 ConnectX2 40GigE PCIe gen2 */ - { PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT }, + { PCI_VDEVICE(MELLANOX, 0x676e), + .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }, /* MT25400 Family [ConnectX-2 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1002), + .driver_data = MLX4_PCI_DEV_IS_VF }, /* MT27500 Family [ConnectX-3] */ - { PCI_VDEVICE(MELLANOX, 0x1003), 0 }, + { PCI_VDEVICE(MELLANOX, 0x1003) }, /* MT27500 Family [ConnectX-3 Virtual Function] */ - { PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF }, - { PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */ - { PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */ - { PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */ - { PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */ - { PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */ - { PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */ - { PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */ - { PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */ - { PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */ - { PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */ - { PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */ - { PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */ + { PCI_VDEVICE(MELLANOX, 0x1004), + .driver_data = MLX4_PCI_DEV_IS_VF }, + { PCI_VDEVICE(MELLANOX, 0x1005) }, /* MT27510 Family */ + { PCI_VDEVICE(MELLANOX, 0x1006) }, /* MT27511 Family */ + { PCI_VDEVICE(MELLANOX, 0x1007) }, /* MT27520 Family */ + { PCI_VDEVICE(MELLANOX, 0x1008) }, /* MT27521 Family */ + { PCI_VDEVICE(MELLANOX, 0x1009) }, /* MT27530 Family */ + { PCI_VDEVICE(MELLANOX, 0x100a) }, /* MT27531 Family */ + { PCI_VDEVICE(MELLANOX, 0x100b) }, /* MT27540 Family */ + { PCI_VDEVICE(MELLANOX, 0x100c) }, /* MT27541 Family */ + { PCI_VDEVICE(MELLANOX, 0x100d) }, /* MT27550 Family */ + { PCI_VDEVICE(MELLANOX, 0x100e) }, /* MT27551 Family */ + { PCI_VDEVICE(MELLANOX, 0x100f) }, /* MT27560 Family */ + { PCI_VDEVICE(MELLANOX, 0x1010) }, /* MT27561 Family */ { 0, } }; From owner-svn-src-stable-10@freebsd.org Mon Jan 9 17:13:37 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E99ACA74B9; Mon, 9 Jan 2017 17:13:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D9591B9C; Mon, 9 Jan 2017 17:13:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09HDaNB087422; Mon, 9 Jan 2017 17:13:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09HDaix087420; Mon, 9 Jan 2017 17:13:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701091713.v09HDaix087420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Jan 2017 17:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311799 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 17:13:37 -0000 Author: hselasky Date: Mon Jan 9 17:13:35 2017 New Revision: 311799 URL: https://svnweb.freebsd.org/changeset/base/311799 Log: MFC r310242: Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid boot panics in conjunction with the recently added EARLY_AP_STARTUP feature. The panics happen due to using kernel facilities like callouts too early. Tested by: jhb @ Modified: stable/10/sys/dev/usb/usb_hub.c stable/10/sys/dev/usb/usb_process.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_hub.c ============================================================================== --- stable/10/sys/dev/usb/usb_hub.c Mon Jan 9 17:12:15 2017 (r311798) +++ stable/10/sys/dev/usb/usb_hub.c Mon Jan 9 17:13:35 2017 (r311799) @@ -2272,6 +2272,11 @@ usb_needs_explore(struct usb_bus *bus, u DPRINTF("\n"); + if (cold != 0) { + DPRINTF("Cold\n"); + return; + } + if (bus == NULL) { DPRINTF("No bus pointer!\n"); return; @@ -2337,6 +2342,26 @@ usb_needs_explore_all(void) } /*------------------------------------------------------------------------* + * usb_needs_explore_init + * + * This function will ensure that the USB controllers are not enumerated + * until the "cold" variable is cleared. + *------------------------------------------------------------------------*/ +static void +usb_needs_explore_init(void *arg) +{ + /* + * The cold variable should be cleared prior to this function + * being called: + */ + if (cold == 0) + usb_needs_explore_all(); + else + DPRINTFN(-1, "Cold variable is still set!\n"); +} +SYSINIT(usb_needs_explore_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, usb_needs_explore_init, NULL); + +/*------------------------------------------------------------------------* * usb_bus_power_update * * This function will ensure that all USB devices on the given bus are Modified: stable/10/sys/dev/usb/usb_process.c ============================================================================== --- stable/10/sys/dev/usb/usb_process.c Mon Jan 9 17:12:15 2017 (r311798) +++ stable/10/sys/dev/usb/usb_process.c Mon Jan 9 17:13:35 2017 (r311799) @@ -455,14 +455,15 @@ usb_proc_drain(struct usb_process *up) up->up_csleep = 0; cv_signal(&up->up_cv); } +#ifndef EARLY_AP_STARTUP /* Check if we are still cold booted */ - if (cold) { USB_THREAD_SUSPEND(up->up_ptr); printf("WARNING: A USB process has " "been left suspended\n"); break; } +#endif cv_wait(&up->up_cv, up->up_mtx); } /* Check if someone is waiting - should not happen */ From owner-svn-src-stable-10@freebsd.org Mon Jan 9 20:14:04 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58842CA74F6; Mon, 9 Jan 2017 20:14:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 246541F35; Mon, 9 Jan 2017 20:14:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09KE3Jm066901; Mon, 9 Jan 2017 20:14:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09KE2oK066891; Mon, 9 Jan 2017 20:14:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701092014.v09KE2oK066891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 20:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311814 - stable/10/contrib/tcp_wrappers X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 20:14:04 -0000 Author: dim Date: Mon Jan 9 20:14:02 2017 New Revision: 311814 URL: https://svnweb.freebsd.org/changeset/base/311814 Log: MFC r257398 (by sbruno): Quiesce warnings by updating headerfile includes r257404 | sbruno | 2013-10-30 23:41:18 +0100 (Wed, 30 Oct 2013) | 9 lines Quiesce two warnings: 1. define the CODE * as const 2. restructure function to eliminate warning about exiting with no return. severity_map() never returns when it can't find an appropriate sysylog facility, and it longjmp()'s away into error code handling. Keep this behavior by stashing the facility value found during our search and checking for -1 if found. MFC r257405 (by sbruno): Quiesce warning, which could be a bug IMO, by correctly defining the host_info structure name MFC r257406 (by sbruno): Queisce warning about undeclared function usage. yp_get_default_domain is defined in workaround.c but is not declared in any header file. Tie the declaration to the same #define conditional used when the function is called, NETGROUP MFC r311459: Put proper prototypes in tcpd.h Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.: /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] extern int hosts_access(); /* access control */ ^ To fix this, turn these declarations into real prototypes. While here, garbage collect the incompatible rfc931() function from scaffold.c, as it is never used. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D9052 MFC r311461: Also remove unnecessary extern keywords from tcpd.h. Noticed by: kib MFC r311556: After r311459, some ports can break, because a few of the newly added prototypes in use FILE. Pull in a minimal forward declaration of FILE from to minimize impact. Sorry for the breakage. Reported by: Shawn Webb Modified: stable/10/contrib/tcp_wrappers/clean_exit.c stable/10/contrib/tcp_wrappers/hosts_access.c stable/10/contrib/tcp_wrappers/options.c stable/10/contrib/tcp_wrappers/percent_x.c stable/10/contrib/tcp_wrappers/rfc931.c stable/10/contrib/tcp_wrappers/scaffold.c stable/10/contrib/tcp_wrappers/shell_cmd.c stable/10/contrib/tcp_wrappers/tcpd.h stable/10/contrib/tcp_wrappers/update.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tcp_wrappers/clean_exit.c ============================================================================== --- stable/10/contrib/tcp_wrappers/clean_exit.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/clean_exit.c Mon Jan 9 20:14:02 2017 (r311814) @@ -13,6 +13,7 @@ static char sccsid[] = "@(#) clean_exit. #endif #include +#include extern void exit(); Modified: stable/10/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- stable/10/contrib/tcp_wrappers/hosts_access.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/hosts_access.c Mon Jan 9 20:14:02 2017 (r311814) @@ -44,6 +44,7 @@ static char sccsid[] = "@(#) hosts_acces #ifdef INET6 #include #endif +#include extern char *fgets(); extern int errno; @@ -102,6 +103,11 @@ static int masked_match6(); #define BUFLEN 2048 +/* definition to be used from workarounds.c */ +#ifdef NETGROUP +int yp_get_default_domain(char **); +#endif + /* hosts_access - host access control facility */ int hosts_access(request) @@ -269,7 +275,7 @@ struct request_info *request; static int hostfile_match(path, host) char *path; -struct hosts_info *host; +struct host_info *host; { char tok[BUFSIZ]; int match = NO; Modified: stable/10/contrib/tcp_wrappers/options.c ============================================================================== --- stable/10/contrib/tcp_wrappers/options.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/options.c Mon Jan 9 20:14:02 2017 (r311814) @@ -50,6 +50,8 @@ static char sccsid[] = "@(#) options.c 1 #include #include #include +#include +#include #ifndef MAXPATHNAMELEN #define MAXPATHNAMELEN BUFSIZ @@ -441,16 +443,21 @@ struct request_info *request; /* severity_map - lookup facility or severity value */ static int severity_map(table, name) -CODE *table; +const CODE *table; char *name; { - CODE *t; + const CODE *t; + int ret = -1; for (t = table; t->c_name; t++) - if (STR_EQ(t->c_name, name)) - return (t->c_val); - tcpd_jump("bad syslog facility or severity: \"%s\"", name); - /* NOTREACHED */ + if (STR_EQ(t->c_name, name)) { + ret = t->c_val; + break; + } + if (ret == -1) + tcpd_jump("bad syslog facility or severity: \"%s\"", name); + + return (ret); } /* severity_option - change logging severity for this event (Dave Mitchell) */ Modified: stable/10/contrib/tcp_wrappers/percent_x.c ============================================================================== --- stable/10/contrib/tcp_wrappers/percent_x.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/percent_x.c Mon Jan 9 20:14:02 2017 (r311814) @@ -19,6 +19,7 @@ static char sccsid[] = "@(#) percent_x.c #include #include #include +#include extern void exit(); Modified: stable/10/contrib/tcp_wrappers/rfc931.c ============================================================================== --- stable/10/contrib/tcp_wrappers/rfc931.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/rfc931.c Mon Jan 9 20:14:02 2017 (r311814) @@ -25,6 +25,7 @@ static char sccsid[] = "@(#) rfc931.c 1. #include #include #include +#include #ifndef SEEK_SET #define SEEK_SET 0 Modified: stable/10/contrib/tcp_wrappers/scaffold.c ============================================================================== --- stable/10/contrib/tcp_wrappers/scaffold.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/scaffold.c Mon Jan 9 20:14:02 2017 (r311814) @@ -235,16 +235,6 @@ struct request_info *request; exit(0); } -/* dummy function to intercept the real rfc931() */ - -/* ARGSUSED */ - -void rfc931(request) -struct request_info *request; -{ - strcpy(request->user, unknown); -} - /* check_path - examine accessibility */ int check_path(path, st) Modified: stable/10/contrib/tcp_wrappers/shell_cmd.c ============================================================================== --- stable/10/contrib/tcp_wrappers/shell_cmd.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/shell_cmd.c Mon Jan 9 20:14:02 2017 (r311814) @@ -16,10 +16,13 @@ static char sccsid[] = "@(#) shell_cmd.c #include #include +#include #include #include #include #include +#include +#include extern void exit(); Modified: stable/10/contrib/tcp_wrappers/tcpd.h ============================================================================== --- stable/10/contrib/tcp_wrappers/tcpd.h Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/tcpd.h Mon Jan 9 20:14:02 2017 (r311814) @@ -6,6 +6,17 @@ * $FreeBSD$ */ +#ifdef INET6 +#define TCPD_SOCKADDR struct sockaddr +#else +#define TCPD_SOCKADDR struct sockaddr_in +#endif + +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif + /* Structure to describe one communications endpoint. */ #define STRING_LENGTH 128 /* hosts, users, processes */ @@ -13,11 +24,7 @@ struct host_info { char name[STRING_LENGTH]; /* access via eval_hostname(host) */ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ -#ifdef INET6 - struct sockaddr *sin; /* socket address or 0 */ -#else - struct sockaddr_in *sin; /* socket address or 0 */ -#endif + TCPD_SOCKADDR *sin; /* socket address or 0 */ struct t_unitdata *unit; /* TLI transport address or 0 */ struct request_info *request; /* for shared information */ }; @@ -67,21 +74,22 @@ extern char paranoid[]; /* Global functions. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void fromhost(); /* get/validate client host info */ +void fromhost(struct request_info *); /* get/validate client host info */ #else #define fromhost sock_host /* no TLI support needed */ #endif -extern int hosts_access(); /* access control */ -extern int hosts_ctl(); /* wrapper around request_init() */ -extern void shell_cmd(); /* execute shell command */ -extern char *percent_x(); /* do % expansion */ -extern void rfc931(); /* client name from RFC 931 daemon */ -extern void clean_exit(); /* clean up and exit */ -extern void refuse(); /* clean up and exit */ -extern char *xgets(); /* fgets() on steroids */ -extern char *split_at(); /* strchr() and split */ -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ +int hosts_access(struct request_info *); /* access control */ +int hosts_ctl(char *, char *, char *, char *); /* wrapper around request_init() */ +void shell_cmd(char *); /* execute shell command */ +char *percent_x(char *, int, char *, struct request_info *); /* do % expansion */ +void rfc931(TCPD_SOCKADDR *, TCPD_SOCKADDR *, char *); /* client name from RFC 931 daemon */ +void clean_exit(struct request_info *); /* clean up and exit */ +void refuse(struct request_info *); /* clean up and exit */ +char *xgets(char *, int, FILE *); /* fgets() on steroids */ + +char *split_at(char *, int); /* strchr() and split */ +unsigned long dot_quad_addr(char *); /* restricted inet_addr() */ /* Global variables. */ @@ -98,13 +106,8 @@ extern int resident; /* > 0 if residen * attributes. Each attribute has its own key. */ -#ifdef __STDC__ -extern struct request_info *request_init(struct request_info *,...); -extern struct request_info *request_set(struct request_info *,...); -#else -extern struct request_info *request_init(); /* initialize request */ -extern struct request_info *request_set(); /* update request structure */ -#endif +struct request_info *request_init(struct request_info *,...); /* initialize request */ +struct request_info *request_set(struct request_info *,...); /* update request structure */ #define RQ_FILE 1 /* file descriptor */ #define RQ_DAEMON 2 /* server process (argv[0]) */ @@ -124,27 +127,27 @@ extern struct request_info *request_set( * host_info structures serve as caches for the lookup results. */ -extern char *eval_user(); /* client user */ -extern char *eval_hostname(); /* printable hostname */ -extern char *eval_hostaddr(); /* printable host address */ -extern char *eval_hostinfo(); /* host name or address */ -extern char *eval_client(); /* whatever is available */ -extern char *eval_server(); /* whatever is available */ +char *eval_user(struct request_info *); /* client user */ +char *eval_hostname(struct host_info *); /* printable hostname */ +char *eval_hostaddr(struct host_info *); /* printable host address */ +char *eval_hostinfo(struct host_info *); /* host name or address */ +char *eval_client(struct request_info *); /* whatever is available */ +char *eval_server(struct request_info *); /* whatever is available */ #define eval_daemon(r) ((r)->daemon) /* daemon process name */ #define eval_pid(r) ((r)->pid) /* process id */ /* Socket-specific methods, including DNS hostname lookups. */ -extern void sock_host(); /* look up endpoint addresses */ -extern void sock_hostname(); /* translate address to hostname */ -extern void sock_hostaddr(); /* address to printable address */ +void sock_host(struct request_info *); /* look up endpoint addresses */ +void sock_hostname(struct host_info *); /* translate address to hostname */ +void sock_hostaddr(struct host_info *); /* address to printable address */ #define sock_methods(r) \ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } /* The System V Transport-Level Interface (TLI) interface. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void tli_host(); /* look up endpoint addresses etc. */ +void tli_host(struct request_info *); /* look up endpoint addresses etc. */ #endif /* @@ -153,13 +156,8 @@ extern void tli_host(); /* look up end * everyone would have to include . */ -#ifdef __STDC__ -extern void tcpd_warn(char *, ...); /* report problem and proceed */ -extern void tcpd_jump(char *, ...); /* report problem and jump */ -#else -extern void tcpd_warn(); -extern void tcpd_jump(); -#endif +void tcpd_warn(char *, ...); /* report problem and proceed */ +void tcpd_jump(char *, ...); /* report problem and jump */ struct tcpd_context { char *file; /* current file */ @@ -185,42 +183,42 @@ extern struct tcpd_context tcpd_context; * behavior. */ -extern void process_options(); /* execute options */ -extern int dry_run; /* verification flag */ +void process_options(char *, struct request_info *); /* execute options */ +extern int dry_run; /* verification flag */ /* Bug workarounds. */ #ifdef INET_ADDR_BUG /* inet_addr() returns struct */ #define inet_addr fix_inet_addr -extern long fix_inet_addr(); +long fix_inet_addr(char *); #endif #ifdef BROKEN_FGETS /* partial reads from sockets */ #define fgets fix_fgets -extern char *fix_fgets(); +char *fix_fgets(char *, int, FILE *); #endif #ifdef RECVFROM_BUG /* no address family info */ #define recvfrom fix_recvfrom -extern int fix_recvfrom(); +int fix_recvfrom(int, char *, int, int, struct sockaddr *, int *); #endif #ifdef GETPEERNAME_BUG /* claims success with UDP */ #define getpeername fix_getpeername -extern int fix_getpeername(); +int fix_getpeername(int, struct sockaddr *, int *); #endif #ifdef SOLARIS_24_GETHOSTBYNAME_BUG /* lists addresses as aliases */ #define gethostbyname fix_gethostbyname -extern struct hostent *fix_gethostbyname(); +struct hostent *fix_gethostbyname(char *); #endif #ifdef USE_STRSEP /* libc calls strtok() */ #define strtok fix_strtok -extern char *fix_strtok(); +char *fix_strtok(char *, char *); #endif #ifdef LIBC_CALLS_STRTOK /* libc calls strtok() */ #define strtok my_strtok -extern char *my_strtok(); +char *my_strtok(char *, char *); #endif Modified: stable/10/contrib/tcp_wrappers/update.c ============================================================================== --- stable/10/contrib/tcp_wrappers/update.c Mon Jan 9 20:13:50 2017 (r311813) +++ stable/10/contrib/tcp_wrappers/update.c Mon Jan 9 20:14:02 2017 (r311814) @@ -24,6 +24,7 @@ static char sccsid[] = "@(#) update.c 1. #include #include #include +#include /* Local stuff. */ From owner-svn-src-stable-10@freebsd.org Tue Jan 10 08:08:51 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12AC1CA98E4; Tue, 10 Jan 2017 08:08:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C83C313AA; Tue, 10 Jan 2017 08:08:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A88ok4059166; Tue, 10 Jan 2017 08:08:50 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A88nx1059163; Tue, 10 Jan 2017 08:08:49 GMT (envelope-from des@FreeBSD.org) Message-Id: <201701100808.v0A88nx1059163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 10 Jan 2017 08:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311863 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:08:51 -0000 Author: des Date: Tue Jan 10 08:08:49 2017 New Revision: 311863 URL: https://svnweb.freebsd.org/changeset/base/311863 Log: MFH (r267371, r297754, r299520): nits and style Modified: stable/10/lib/libfetch/fetch.3 stable/10/lib/libfetch/ftp.c stable/10/lib/libfetch/http.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/fetch.3 ============================================================================== --- stable/10/lib/libfetch/fetch.3 Tue Jan 10 07:50:21 2017 (r311862) +++ stable/10/lib/libfetch/fetch.3 Tue Jan 10 08:08:49 2017 (r311863) @@ -783,27 +783,27 @@ library first appeared in The .Nm fetch library was mostly written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org with numerous suggestions and contributions from -.An Jordan K. Hubbard Aq jkh@FreeBSD.org , -.An Eugene Skepner Aq eu@qub.com , -.An Hajimu Umemoto Aq ume@FreeBSD.org , -.An Henry Whincup Aq henry@techiebod.com , -.An Jukka A. Ukkonen Aq jau@iki.fi , -.An Jean-Fran\(,cois Dockes Aq jf@dockes.org , -.An Michael Gmelin Aq freebsd@grem.de +.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org , +.An Eugene Skepner Aq Mt eu@qub.com , +.An Hajimu Umemoto Aq Mt ume@FreeBSD.org , +.An Henry Whincup Aq Mt henry@techiebod.com , +.An Jukka A. Ukkonen Aq Mt jau@iki.fi , +.An Jean-Fran\(,cois Dockes Aq Mt jf@dockes.org , +.An Michael Gmelin Aq Mt freebsd@grem.de and others. It replaces the older .Nm ftpio library written by -.An Poul-Henning Kamp Aq phk@FreeBSD.org +.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org and -.An Jordan K. Hubbard Aq jkh@FreeBSD.org . +.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org . .Pp This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org and -.An Michael Gmelin Aq freebsd@grem.de . +.An Michael Gmelin Aq Mt freebsd@grem.de . .Sh BUGS Some parts of the library are not yet implemented. The most notable Modified: stable/10/lib/libfetch/ftp.c ============================================================================== --- stable/10/lib/libfetch/ftp.c Tue Jan 10 07:50:21 2017 (r311862) +++ stable/10/lib/libfetch/ftp.c Tue Jan 10 08:08:49 2017 (r311863) @@ -929,7 +929,7 @@ ftp_authenticate(conn_t *conn, struct ur if (*pwd == '\0') pwd = getenv("FTP_PASSWORD"); if (pwd == NULL || *pwd == '\0') { - if ((logname = getlogin()) == 0) + if ((logname = getlogin()) == NULL) logname = FTP_ANONYMOUS_USER; if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) < 0) len = 0; Modified: stable/10/lib/libfetch/http.c ============================================================================== --- stable/10/lib/libfetch/http.c Tue Jan 10 07:50:21 2017 (r311862) +++ stable/10/lib/libfetch/http.c Tue Jan 10 08:08:49 2017 (r311863) @@ -875,7 +875,7 @@ http_parse_mtime(const char *p, time_t * char locale[64], *r; struct tm tm; - strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); + strlcpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm); /* From owner-svn-src-stable-10@freebsd.org Tue Jan 10 08:12:57 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EC1FCA9AB0; Tue, 10 Jan 2017 08:12:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B0D4186B; Tue, 10 Jan 2017 08:12:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A8CuR9063079; Tue, 10 Jan 2017 08:12:56 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A8CutO063078; Tue, 10 Jan 2017 08:12:56 GMT (envelope-from des@FreeBSD.org) Message-Id: <201701100812.v0A8CutO063078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 10 Jan 2017 08:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311864 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:12:57 -0000 Author: des Date: Tue Jan 10 08:12:56 2017 New Revision: 311864 URL: https://svnweb.freebsd.org/changeset/base/311864 Log: MFH (r301027): fix 307 / 308 redirects MFH (r310823): fix multi-line CONNECT responses PR: 112515 173451 194483 209546 Modified: stable/10/lib/libfetch/http.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/http.c ============================================================================== --- stable/10/lib/libfetch/http.c Tue Jan 10 08:08:49 2017 (r311863) +++ stable/10/lib/libfetch/http.c Tue Jan 10 08:12:56 2017 (r311864) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \ || (xyz) == HTTP_MOVED_TEMP \ || (xyz) == HTTP_TEMP_REDIRECT \ + || (xyz) == HTTP_PERM_REDIRECT \ || (xyz) == HTTP_USE_PROXY \ || (xyz) == HTTP_SEE_OTHER) @@ -1431,7 +1432,7 @@ http_connect(struct url *URL, struct url default: /* ignore */ ; } - } while (h < hdr_end); + } while (h > hdr_end); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { @@ -1767,6 +1768,8 @@ http_request_body(struct url *URL, const break; case HTTP_MOVED_PERM: case HTTP_MOVED_TEMP: + case HTTP_TEMP_REDIRECT: + case HTTP_PERM_REDIRECT: case HTTP_SEE_OTHER: case HTTP_USE_PROXY: /* From owner-svn-src-stable-10@freebsd.org Tue Jan 10 08:25:04 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49D3ECA9E26; Tue, 10 Jan 2017 08:25:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 161D71F4C; Tue, 10 Jan 2017 08:25:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0A8P3YK067149; Tue, 10 Jan 2017 08:25:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0A8P38T067148; Tue, 10 Jan 2017 08:25:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701100825.v0A8P38T067148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 08:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311866 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:25:04 -0000 Author: mav Date: Tue Jan 10 08:25:03 2017 New Revision: 311866 URL: https://svnweb.freebsd.org/changeset/base/311866 Log: MFC r310633: Add MAX_LUNS overflow safety checks. While this MAX_LUNS limitation is too synthetic and should be removed, it is better to enforce it while it is here. Modified: stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Jan 10 08:23:06 2017 (r311865) +++ stable/10/usr.sbin/ctld/parse.y Tue Jan 10 08:25:03 2017 (r311866) @@ -808,6 +808,11 @@ lun_number: STR free($1); return (1); } + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($1); + return (1); + } ret = asprintf(&name, "%s,lun,%ju", target->t_name, tmp); if (ret <= 0) @@ -832,6 +837,11 @@ target_lun_ref: LUN STR STR return (1); } free($2); + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($3); + return (1); + } lun = lun_find(conf, $3); free($3); From owner-svn-src-stable-10@freebsd.org Tue Jan 10 19:15:38 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B06CA9B1F; Tue, 10 Jan 2017 19:15:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87316185C; Tue, 10 Jan 2017 19:15:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AJFb5Z036104; Tue, 10 Jan 2017 19:15:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJFbrD036103; Tue, 10 Jan 2017 19:15:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701101915.v0AJFbrD036103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 19:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311883 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:15:38 -0000 Author: mav Date: Tue Jan 10 19:15:37 2017 New Revision: 311883 URL: https://svnweb.freebsd.org/changeset/base/311883 Log: MFC r309251: Process port interrupt even is PxIS register is zero. ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside seems sometimes forgeting to set bits in PxIS, causing command timeouts. Removal of this check fixes the issue by the theoretical cost of slightly higher CPU usage in some odd cases, but this is what Linux does too. Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Tue Jan 10 19:15:07 2017 (r311882) +++ stable/10/sys/dev/ahci/ahci.c Tue Jan 10 19:15:37 2017 (r311883) @@ -1122,8 +1122,6 @@ ahci_ch_intr(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ahci_ch_intr_main(ch, istatus); @@ -1140,8 +1138,6 @@ ahci_ch_intr_direct(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ch->batch = 1; From owner-svn-src-stable-10@freebsd.org Tue Jan 10 19:16:51 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 343C8CA9C59; Tue, 10 Jan 2017 19:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0603B1B66; Tue, 10 Jan 2017 19:16:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0AJGoQi036257; Tue, 10 Jan 2017 19:16:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0AJGoxM036256; Tue, 10 Jan 2017 19:16:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701101916.v0AJGoxM036256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Jan 2017 19:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311885 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 19:16:51 -0000 Author: mav Date: Tue Jan 10 19:16:50 2017 New Revision: 311885 URL: https://svnweb.freebsd.org/changeset/base/311885 Log: MFC r309252: Add more ASMedia PCI IDs from different sources. Exact device names are not clear, but its better then nothing at all. Modified: stable/10/sys/dev/ahci/ahci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci_pci.c Tue Jan 10 19:16:17 2017 (r311884) +++ stable/10/sys/dev/ahci/ahci_pci.c Tue Jan 10 19:16:50 2017 (r311885) @@ -73,8 +73,15 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06111b21, 0x00, "ASMedia ASM2106", 0}, - {0x06121b21, 0x00, "ASMedia ASM1061", 0}, + {0x06011b21, 0x00, "ASMedia ASM1060", 0}, + {0x06021b21, 0x00, "ASMedia ASM1060", 0}, + {0x06111b21, 0x00, "ASMedia ASM1061", 0}, + {0x06121b21, 0x00, "ASMedia ASM1062", 0}, + {0x06201b21, 0x00, "ASMedia ASM106x", 0}, + {0x06211b21, 0x00, "ASMedia ASM106x", 0}, + {0x06221b21, 0x00, "ASMedia ASM106x", 0}, + {0x06241b21, 0x00, "ASMedia ASM106x", 0}, + {0x06251b21, 0x00, "ASMedia ASM106x", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-stable-10@freebsd.org Wed Jan 11 05:56:43 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FDA7CAAA59; Wed, 11 Jan 2017 05:56:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5311979; Wed, 11 Jan 2017 05:56:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0B5ug2v099261; Wed, 11 Jan 2017 05:56:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B5ufq5099254; Wed, 11 Jan 2017 05:56:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701110556.v0B5ufq5099254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Jan 2017 05:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311915 - in stable: 10/crypto/openssh 11/crypto/openssh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 05:56:43 -0000 Author: delphij Date: Wed Jan 11 05:56:40 2017 New Revision: 311915 URL: https://svnweb.freebsd.org/changeset/base/311915 Log: MFC r311914: MFV r311913: Fix multiple OpenSSH vulnerabilities. Submitted by: des Approved by: so Modified: stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/ssh-agent.1 stable/10/crypto/openssh/ssh-agent.c stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/version.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/crypto/openssh/serverloop.c stable/11/crypto/openssh/ssh-agent.1 stable/11/crypto/openssh/ssh-agent.c stable/11/crypto/openssh/ssh_config stable/11/crypto/openssh/ssh_config.5 stable/11/crypto/openssh/sshd_config stable/11/crypto/openssh/sshd_config.5 stable/11/crypto/openssh/version.h Directory Properties: stable/11/ (props changed) Modified: stable/10/crypto/openssh/serverloop.c ============================================================================== --- stable/10/crypto/openssh/serverloop.c Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/serverloop.c Wed Jan 11 05:56:40 2017 (r311915) @@ -995,7 +995,7 @@ server_request_direct_streamlocal(void) /* XXX fine grained permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 && - !no_port_forwarding_flag) { + !no_port_forwarding_flag && use_privsep) { c = channel_connect_to_path(target, "direct-streamlocal@openssh.com", "direct-streamlocal"); } else { @@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_ /* check permissions */ if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0 - || no_port_forwarding_flag) { + || no_port_forwarding_flag || !use_privsep) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { Modified: stable/10/crypto/openssh/ssh-agent.1 ============================================================================== --- stable/10/crypto/openssh/ssh-agent.1 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh-agent.1 Wed Jan 11 05:56:40 2017 (r311915) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-agent.1,v 1.62 2015/11/15 23:54:15 jmc Exp $ +.\" $OpenBSD: ssh-agent.1,v 1.63 2016/11/30 03:07:37 djm Exp $ .\" $FreeBSD$ .\" .\" Author: Tatu Ylonen @@ -48,6 +48,7 @@ .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash .Op Fl t Ar life +.Op Fl P Ar pkcs11_whitelist .Op Ar command Op Ar arg ... .Nm ssh-agent .Op Fl c | s @@ -122,6 +123,18 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl P +Specify a pattern-list of acceptable paths for PKCS#11 shared libraries +that may be added using the +.Fl s +option to +.Xr ssh-add 1 . +The default is to allow loading PKCS#11 libraries from +.Dq /usr/lib/*,/usr/local/lib/* . +PKCS#11 libraries that do not match the whitelist will be refused. +See PATTERNS in +.Xr ssh_config 5 +for a description of pattern-list syntax. .It Fl s Generate Bourne shell commands on .Dv stdout . Modified: stable/10/crypto/openssh/ssh-agent.c ============================================================================== --- stable/10/crypto/openssh/ssh-agent.c Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh-agent.c Wed Jan 11 05:56:40 2017 (r311915) @@ -84,11 +84,16 @@ __RCSID("$FreeBSD$"); #include "misc.h" #include "digest.h" #include "ssherr.h" +#include "match.h" #ifdef ENABLE_PKCS11 #include "ssh-pkcs11.h" #endif +#ifndef DEFAULT_PKCS11_WHITELIST +# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*" +#endif + #if defined(HAVE_SYS_PRCTL_H) #include /* For prctl() and PR_SET_DUMPABLE */ #endif @@ -140,6 +145,9 @@ pid_t cleanup_pid = 0; char socket_name[PATH_MAX]; char socket_dir[PATH_MAX]; +/* PKCS#11 path whitelist */ +static char *pkcs11_whitelist; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -761,7 +769,7 @@ no_identities(SocketEntry *e, u_int type static void process_add_smartcard_key(SocketEntry *e) { - char *provider = NULL, *pin; + char *provider = NULL, *pin, canonical_provider[PATH_MAX]; int r, i, version, count = 0, success = 0, confirm = 0; u_int seconds; time_t death = 0; @@ -793,10 +801,21 @@ process_add_smartcard_key(SocketEntry *e goto send; } } + if (realpath(provider, canonical_provider) == NULL) { + verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", + provider, strerror(errno)); + goto send; + } + if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) { + verbose("refusing PKCS#11 add of \"%.100s\": " + "provider not whitelisted", canonical_provider); + goto send; + } + debug("%s: add %.100s", __func__, canonical_provider); if (lifetime && !death) death = monotime() + lifetime; - count = pkcs11_add_provider(provider, pin, &keys); + count = pkcs11_add_provider(canonical_provider, pin, &keys); for (i = 0; i < count; i++) { k = keys[i]; version = k->type == KEY_RSA1 ? 1 : 2; @@ -804,8 +823,8 @@ process_add_smartcard_key(SocketEntry *e if (lookup_identity(k, version) == NULL) { id = xcalloc(1, sizeof(Identity)); id->key = k; - id->provider = xstrdup(provider); - id->comment = xstrdup(provider); /* XXX */ + id->provider = xstrdup(canonical_provider); + id->comment = xstrdup(canonical_provider); /* XXX */ id->death = death; id->confirm = confirm; TAILQ_INSERT_TAIL(&tab->idlist, id, next); @@ -1200,7 +1219,7 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]\n" - " [-t life] [command [arg ...]]\n" + " [-P pkcs11_whitelist] [-t life] [command [arg ...]]\n" " ssh-agent [-c | -s] -k\n"); fprintf(stderr, " -x Exit when the last client disconnects.\n"); exit(1); @@ -1246,7 +1265,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cDdksE:a:t:x")) != -1) { + while ((ch = getopt(ac, av, "cDdksE:a:P:t:x")) != -1) { switch (ch) { case 'E': fingerprint_hash = ssh_digest_alg_by_name(optarg); @@ -1261,6 +1280,11 @@ main(int ac, char **av) case 'k': k_flag++; break; + case 'P': + if (pkcs11_whitelist != NULL) + fatal("-P option already specified"); + pkcs11_whitelist = xstrdup(optarg); + break; case 's': if (c_flag) usage(); @@ -1298,6 +1322,9 @@ main(int ac, char **av) if (ac > 0 && (c_flag || k_flag || s_flag || d_flag || D_flag)) usage(); + if (pkcs11_whitelist == NULL) + pkcs11_whitelist = xstrdup(DEFAULT_PKCS11_WHITELIST); + if (ac == 0 && !c_flag && !s_flag) { shell = getenv("SHELL"); if (shell != NULL && (len = strlen(shell)) > 2 && @@ -1445,7 +1472,7 @@ skip: signal(SIGTERM, cleanup_handler); nalloc = 0; - if (pledge("stdio cpath unix id proc exec", NULL) == -1) + if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) fatal("%s: pledge: %s", __progname, strerror(errno)); platform_pledge_agent(); Modified: stable/10/crypto/openssh/ssh_config ============================================================================== --- stable/10/crypto/openssh/ssh_config Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh_config Wed Jan 11 05:56:40 2017 (r311915) @@ -50,4 +50,4 @@ # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # VerifyHostKeyDNS yes -# VersionAddendum FreeBSD-20160310 +# VersionAddendum FreeBSD-20161230 Modified: stable/10/crypto/openssh/ssh_config.5 ============================================================================== --- stable/10/crypto/openssh/ssh_config.5 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/ssh_config.5 Wed Jan 11 05:56:40 2017 (r311915) @@ -1733,7 +1733,7 @@ See also VERIFYING HOST KEYS in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: stable/10/crypto/openssh/sshd_config ============================================================================== --- stable/10/crypto/openssh/sshd_config Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/sshd_config Wed Jan 11 05:56:40 2017 (r311915) @@ -120,7 +120,7 @@ #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum FreeBSD-20160310 +#VersionAddendum FreeBSD-20161230 # no default banner path #Banner none Modified: stable/10/crypto/openssh/sshd_config.5 ============================================================================== --- stable/10/crypto/openssh/sshd_config.5 Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/sshd_config.5 Wed Jan 11 05:56:40 2017 (r311915) @@ -1631,7 +1631,7 @@ The default is Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Dq FreeBSD-20160310 . +.Dq FreeBSD-20161230 . The value .Dq none may be used to disable this. Modified: stable/10/crypto/openssh/version.h ============================================================================== --- stable/10/crypto/openssh/version.h Wed Jan 11 05:49:39 2017 (r311914) +++ stable/10/crypto/openssh/version.h Wed Jan 11 05:56:40 2017 (r311915) @@ -6,7 +6,7 @@ #define SSH_PORTABLE "p2" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20160310" +#define SSH_VERSION_FREEBSD "FreeBSD-20161230" #ifdef WITH_OPENSSL #define OPENSSL_VERSION SSLeay_version(SSLEAY_VERSION) From owner-svn-src-stable-10@freebsd.org Wed Jan 11 07:46:02 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F24CAAE92; Wed, 11 Jan 2017 07:46:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD9871130; Wed, 11 Jan 2017 07:46:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0B7k1I5043845; Wed, 11 Jan 2017 07:46:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0B7k1hs043844; Wed, 11 Jan 2017 07:46:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701110746.v0B7k1hs043844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Jan 2017 07:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311921 - stable/10/sys/dev/isci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 07:46:03 -0000 Author: mav Date: Wed Jan 11 07:46:01 2017 New Revision: 311921 URL: https://svnweb.freebsd.org/changeset/base/311921 Log: MFC r310703: Pass proper arguments (handles, not directly structure pointers) to scif_cb_domain_device_removed(). This should fix NULL dereference on task management function timeout. Modified: stable/10/sys/dev/isci/isci_task_request.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isci/isci_task_request.c ============================================================================== --- stable/10/sys/dev/isci/isci_task_request.c Wed Jan 11 07:45:29 2017 (r311920) +++ stable/10/sys/dev/isci/isci_task_request.c Wed Jan 11 07:46:01 2017 (r311921) @@ -210,8 +210,9 @@ isci_task_request_complete(SCI_CONTROLLE retry_task = FALSE; isci_log_message(0, "ISCI", "task timeout - not retrying\n"); - scif_cb_domain_device_removed(isci_controller, - isci_remote_device->domain, isci_remote_device); + scif_cb_domain_device_removed(scif_controller, + isci_remote_device->domain->sci_object, + remote_device); } else { retry_task = TRUE; isci_log_message(0, "ISCI", From owner-svn-src-stable-10@freebsd.org Wed Jan 11 20:45:29 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0832ECAB71A; Wed, 11 Jan 2017 20:45:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAB5E1357; Wed, 11 Jan 2017 20:45:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BKjS8m063796; Wed, 11 Jan 2017 20:45:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BKjSKQ063795; Wed, 11 Jan 2017 20:45:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112045.v0BKjSKQ063795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 20:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311937 - in stable: 10/contrib/ngatm/snmp_atm 11/contrib/ngatm/snmp_atm 9/contrib/ngatm/snmp_atm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 20:45:29 -0000 Author: dim Date: Wed Jan 11 20:45:27 2017 New Revision: 311937 URL: https://svnweb.freebsd.org/changeset/base/311937 Log: MFC r311649: Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c: contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!ifmr.ifm_status & IFM_AVALID) { ^ ~ Obviously, the masking needs to be done before the logical not operation. Add parentheses to make it so. Modified: stable/10/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ngatm/snmp_atm/snmp_atm.c stable/9/contrib/ngatm/snmp_atm/snmp_atm.c Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) Modified: stable/10/contrib/ngatm/snmp_atm/snmp_atm.c ============================================================================== --- stable/10/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:29:58 2017 (r311936) +++ stable/10/contrib/ngatm/snmp_atm/snmp_atm.c Wed Jan 11 20:45:27 2017 (r311937) @@ -170,7 +170,7 @@ atmif_check_carrier(struct atmif_priv *a aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } - if (!ifmr.ifm_status & IFM_AVALID) { + if (!(ifmr.ifm_status & IFM_AVALID)) { aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; return; } From owner-svn-src-stable-10@freebsd.org Wed Jan 11 21:01:51 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C31CAA023; Wed, 11 Jan 2017 21:01:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D69F61504; Wed, 11 Jan 2017 21:01:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BL1ojS069903; Wed, 11 Jan 2017 21:01:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BL1o8K069902; Wed, 11 Jan 2017 21:01:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701112101.v0BL1o8K069902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Jan 2017 21:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311939 - in stable: 10/sys/geom/vinum 11/sys/geom/vinum 9/sys/geom/vinum X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 21:01:51 -0000 Author: dim Date: Wed Jan 11 21:01:49 2017 New Revision: 311939 URL: https://svnweb.freebsd.org/changeset/base/311939 Log: MFC r311688: Fix logic error in gvinum's gv_set_sd_state() With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg Differential Revision: https://reviews.freebsd.org/D9093 Modified: stable/10/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/geom/vinum/geom_vinum_state.c stable/9/sys/geom/vinum/geom_vinum_state.c Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/sys/geom/vinum/geom_vinum_state.c ============================================================================== --- stable/10/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 20:55:01 2017 (r311938) +++ stable/10/sys/geom/vinum/geom_vinum_state.c Wed Jan 11 21:01:49 2017 (r311939) @@ -183,7 +183,7 @@ gv_set_sd_state(struct gv_sd *s, int new * Only do this if we're forced, since it usually is done * internally, and then we do use the force flag. */ - if (!flags & GV_SETSTATE_FORCE) + if (!(flags & GV_SETSTATE_FORCE)) return (GV_ERR_SETSTATE); break; From owner-svn-src-stable-10@freebsd.org Wed Jan 11 22:10:57 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47890CABADD; Wed, 11 Jan 2017 22:10:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FD8160A; Wed, 11 Jan 2017 22:10:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BMAud6096802; Wed, 11 Jan 2017 22:10:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0BMAuLv096801; Wed, 11 Jan 2017 22:10:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701112210.v0BMAuLv096801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 Jan 2017 22:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311944 - stable/10/share/misc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:10:57 -0000 Author: bapt Date: Wed Jan 11 22:10:56 2017 New Revision: 311944 URL: https://svnweb.freebsd.org/changeset/base/311944 Log: MFC r311706: Update pciids to 2017.01.08 Modified: stable/10/share/misc/pci_vendors Directory Properties: stable/10/ (props changed) Modified: stable/10/share/misc/pci_vendors ============================================================================== --- stable/10/share/misc/pci_vendors Wed Jan 11 22:10:41 2017 (r311943) +++ stable/10/share/misc/pci_vendors Wed Jan 11 22:10:56 2017 (r311944) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.11.21 -# Date: 2016-11-21 03:15:01 +# Version: 2017.01.08 +# Date: 2017-01-08 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -249,6 +249,7 @@ 0014 MegaRAID Tri-Mode SAS3516 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter + 0015 MegaRAID Tri-Mode SAS3416 0016 MegaRAID Tri-Mode SAS3508 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter @@ -548,6 +549,7 @@ 1028 1f53 HBA330 Mini 1028 1fd2 HBA330 MX 1028 1fd3 HBA330 MMZ + 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0201 ThinkSystem 430-16i SAS/SATA 12Gb HBA @@ -2201,6 +2203,11 @@ 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE 67c0 Ellesmere [Polaris10] + 67c4 Ellesmere [Radeon Pro WX 7100] + 67c7 Ellesmere [Radeon Pro WX 5100] + 67ca Ellesmere [Polaris10] + 67cc Ellesmere [Polaris10] + 67cf Ellesmere [Polaris10] 67df Ellesmere [Radeon RX 470/480] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 @@ -2218,6 +2225,7 @@ 1787 a480 Radeon RX 480 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] + 67e3 Baffin [Radeon Pro WX 4100] 67e8 Baffin [Polaris11] 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] @@ -2924,6 +2932,12 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 + 6980 Polaris12 + 6981 Polaris12 + 6985 Polaris12 + 6986 Polaris12 + 6987 Polaris12 + 699f Polaris12 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -5095,6 +5109,7 @@ 0675 1704 ISDN Adapter (PCI Bus, D, C) 0675 1707 ISDN Adapter (PCI Bus, DV, W) 10cf 105e ISDN Adapter (PCI Bus, DV, W) + 13a0 Transformer Book T101HA-GR030R # Should be 1022:9602 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 1043 83a2 M4A785TD Motherboard @@ -10077,6 +10092,7 @@ 10c3 GT218 [GeForce 8400 GS Rev. 3] 10c5 GT218 [GeForce 405] 10d8 GT218 [NVS 300] + 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M @@ -10620,7 +10636,7 @@ 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] 13f3 GM204GL [Tesla M6] - 13f8 GM204GLM [Quadro M5000M] + 13f8 GM204GLM [Quadro M5000M / M5000 SE] 13f9 GM204GLM [Quadro M4000M] 13fa GM204GLM [Quadro M3000M] 10de 11c9 Quadro M3000 SE @@ -10634,8 +10650,9 @@ 1431 GM206GL [Tesla M4] 15f0 GP100GL 15f1 GP100GL - 15f8 GP100GL - 15f9 GP100GL + 15f7 GP100GL [Tesla P100 PCIe 12GB] + 15f8 GP100GL [Tesla P100 PCIe 16GB] + 15f9 GP100GL [Tesla P100 SMX2 16GB] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] @@ -10659,10 +10676,12 @@ 1b81 GP104 [GeForce GTX 1070] 1b82 GP104 1b83 GP104 + 1b84 GP104 [GeForce GTX 1060 3GB] 1ba0 GP104M [GeForce GTX 1080] 1ba1 GP104M [GeForce GTX 1070] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL + 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL 1be0 GP104M [GeForce GTX 1080] 1be1 GP104M [GeForce GTX 1070] @@ -10678,6 +10697,9 @@ 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] + 1c8c GP107M [GeForce GTX 1050 Ti] + 1c8d GP107M [GeForce GTX 1050] + 1c8e GP107M 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -12103,7 +12125,11 @@ 111f Precision Digital Images 4a47 Precision MX Video engine interface 5243 Frame capture bus interface -1120 EMC Corporation +# formerly EMC Corporation +1120 Dell EMC + 2306 Unity Fibre Channel Controller + 2501 Unity Ethernet Controller + 2505 Unity Fibre Channel Controller 1121 Zilog 1122 Multi-tech Systems, Inc. 1123 Excellent Design, Inc. @@ -15975,7 +16001,7 @@ 5081 T540-5081 Unified Wire Ethernet Controller 5082 T504-5082 Unified Wire Ethernet Controller 5083 T540-5083 Unified Wire Ethernet Controller - 5084 T580-5084 Unified Wire Ethernet Controller + 5084 T540-5084 Unified Wire Ethernet Controller 5085 T580-5085 Unified Wire Ethernet Controller 5086 T580-5086 Unified Wire Ethernet Controller 5087 T580-5087 Unified Wire Ethernet Controller @@ -15994,6 +16020,7 @@ 509a T520-509A Unified Wire Ethernet Controller 509b T540-509B Unified Wire Ethernet Controller 509c T520-509C Unified Wire Ethernet Controller + 509d T540-509D Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16041,6 +16068,7 @@ 549a T520-509A Unified Wire Ethernet Controller 549b T540-509B Unified Wire Ethernet Controller 549c T520-509C Unified Wire Ethernet Controller + 549d T540-509D Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16088,6 +16116,7 @@ 559a T520-509A Unified Wire Storage Controller 559b T540-509B Unified Wire Storage Controller 559c T520-509C Unified Wire Storage Controller + 559d T540-509D Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16135,6 +16164,7 @@ 569a T520-509A Unified Wire Storage Controller 569b T540-509B Unified Wire Storage Controller 569c T520-509C Unified Wire Storage Controller + 569d T540-509D Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16221,6 +16251,7 @@ 589a T520-509A Unified Wire Ethernet Controller [VF] 589b T540-509B Unified Wire Ethernet Controller [VF] 589c T520-509C Unified Wire Ethernet Controller [VF] + 589d T540-509D Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16357,7 +16388,8 @@ 144d Samsung Electronics Co Ltd 1600 Apple PCIe SSD a800 XP941 PCIe SSD - a802 NVMe SSD Controller + a802 NVMe SSD Controller SM951/PM951 + a804 NVMe SSD Controller SM961/PM961 a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -17968,11 +18000,13 @@ 15b3 Mellanox Technologies 0191 MT25408 [ConnectX IB Flash Recovery] 01f6 MT27500 Family [ConnectX-3 Flash Recovery] + 01f8 MT27520 Family [ConnectX-3 Pro Flash Recovery] 01ff MT27600 Family [Connect-IB Flash Recovery] 0209 MT27700 Family [ConnectX-4 Flash Recovery] 020b MT27710 Family [ConnectX-4 Lx Flash Recovery] 020d MT28800 Family [ConnectX-5 Flash Recovery] 020f MT28908A0 Family [ConnectX-6 Flash Recovery] + 0211 MT416842 Family [BlueField SoC Flash Recovery] # reserved for RM#105916 024e MT53100 [Spectrum-2, Flash recovery mode] # Actual value to be used @@ -18732,6 +18766,7 @@ 7013 AP440-3: 32-Channel Isolated Digital Input Module 7014 AP445: 32-Channel Isolated Digital Output Module 7016 AP470 48-Channel TTL Level Digital Input/Output Module + 7017 AP323 16-bit, 20 or 40 Channel Analog Input Module 7018 AP408: 32-Channel Digital I/O Module 701a AP220-16 12-Bit, 16-Channel Analog Output Module 701b AP231-16 16-Bit, 16-Channel Analog Output Module @@ -18992,6 +19027,7 @@ 1160 ARC-1160 16-Port PCI-X to SATA RAID Controller 1170 ARC-1170 24-Port PCI-X to SATA RAID Controller 1201 ARC-1200 2-Port PCI-Express to SATA II RAID Controller + 1203 ARC-1203 2/4/8 Port PCIe 2.0 to SATA 6Gb RAID Controller 1210 ARC-1210 4-Port PCI-Express to SATA RAID Controller 1214 ARC-12x4 PCIe 2.0 to SAS/SATA 6Gb RAID Controller 17d3 1214 ARC-1214 4-Port PCIe 2.0 to SAS/SATA 6Gb RAID Controller @@ -19510,7 +19546,7 @@ 1924 5105 SFN4111T-R5 1924 5201 SFN4112F-R1 1924 5202 SFN4112F-R2 - 0803 SFC9020 [Solarstorm] + 0803 SFC9020 10G Ethernet Controller 1014 0478 2-port 10GbE Low-Latency (R7) 1014 0479 2-port 10GbE OpenOnload (R7) 1014 04a7 Solarflare 10Gb Low-latency Dual-port HBA (R7) @@ -19540,7 +19576,7 @@ 1924 7207 SFN5162F-R7 SFP+ Server Adapter 1924 7a06 SFN5152F-R6 SFP+ Server Adapter 1924 7a07 SFN5152F-R7 SFP+ Server Adapter - 0813 SFL9021 [Solarstorm] + 0813 SFL9021 10GBASE-T Ethernet Controller 1924 6100 SFN5121T-R0 10GBASE-T Server Adapter 1924 6102 SFN5121T-R2 10GBASE-T Server Adapter 1924 6103 SFN5121T-R3 10GBASE-T Server Adapter @@ -19549,7 +19585,7 @@ 1924 6904 SFN5111T-R4 10GBASE-T Server Adapter 1924 7104 SFN5161T-R4 10GBASE-T Server Adapter 1924 7904 SFN5151T-R4 10GBASE-T Server Adapter - 0903 SFC9120 + 0903 SFC9120 10G Ethernet Controller 1014 04cc SFN7122F-R2 2x10GbE SFP+ Flareon Ultra 1924 8002 SFN7122F-R1 SFP+ Server Adapter 1924 8003 SFN7x41Q-R1 Flareon Ultra 7000 Series 10/40G Adapter @@ -19561,11 +19597,11 @@ 1924 800d SFN7x02F-R3 Flareon 7000 Series 10G Adapter 1924 8010 SFA7942Q-R1 QSFP+ AOE Adapter 1924 8015 SFA7942Q-A5-0-R1 QSFP+ AOE Adapter - 0923 SFC9140 + 0923 SFC9140 10/40G Ethernet Controller 1924 800b SFN7x42Q-R1 Flareon Ultra 7000 Series 10/40G Adapter 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter - 0a03 SFC9220 + 0a03 SFC9220 10/40G Ethernet Controller 1924 8011 SFN 8022-R1 Solarflare Flareon 8000 Series 10G Adapter 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter 1924 8013 SFN8042-R1 Solarflare Flareon 8000 Series 10/40G Adapter @@ -19574,10 +19610,11 @@ 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter - 1803 SFC9020 Virtual Function [Solarstorm] - 1813 SFL9021 Virtual Function [Solarstorm] - 1903 SFC9120 Virtual Function - 1923 SFC9140 Virtual Function + 1803 SFC9020 10G Ethernet Controller (Virtual Function) + 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) + 1903 SFC9120 10G Ethernet Controller (Virtual Function) + 1923 SFC9140 10/40G Ethernet Controller (Virtual Function) + 1a03 SFC9220 10/40G Ethernet Controller (Virtual Function) 6703 SFC4000 rev A iSCSI/Onload [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -19864,6 +19901,7 @@ 5801 DDRdrive X1 5808 DDRdrive X8 dd52 DDRdrive X1-30 +19e5 Huawei Technologies Co., Ltd. 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card 1002 STIX - 1 Port T1/E1 Card @@ -20303,6 +20341,8 @@ 0303 Simulyzer-RT CompactPCI Serial PSI5-SIM-1 card 0304 Simulyzer-RT CompactPCI Serial PWR-ANA-1 card 0305 Simulyzer-RT CompactPCI Serial CAN-1 card +1cd7 Nanjing Magewell Electronics Co., Ltd. + 0010 Pro Capture Endpoint 1cdd secunet Security Networks AG 1ce4 Exablaze 0001 ExaNIC X4 @@ -20310,6 +20350,7 @@ 0003 ExaNIC X10 0004 ExaNIC X10-GM 0005 ExaNIC X40 + 0006 ExaNIC X10-HPT 1cf7 Subspace Dynamics 1d00 Pure Storage 1d1d CNEX Labs @@ -21336,6 +21377,27 @@ 0813 Moorestown SC DMA 0814 Moorestown LPE DMA 0815 Moorestown SSP0 + 0817 Medfield Serial IO I2C Controller #3 + 0818 Medfield Serial IO I2C Controller #4 + 0819 Medfield Serial IO I2C Controller #5 + 081a Medfield GPIO Controller [Core] + 081b Medfield Serial IO HSUART Controller #1 + 081c Medfield Serial IO HSUART Controller #2 + 081d Medfield Serial IO HSUART Controller #3 + 081e Medfield Serial IO HSUART DMA Controller + 081f Medfield GPIO Controller [AON] + 0820 Medfield SD Host Controller + 0821 Medfield SDIO Controller #1 + 0822 Medfield SDIO Controller #2 + 0823 Medfield eMMC Controller #0 + 0824 Medfield eMMC Controller #1 + 0827 Medfield Serial IO DMA Controller + 0828 Medfield Power Management Unit + 0829 Medfield USB Device Controller (OTG) + 082a Medfield SCU IPC + 082c Medfield Serial IO I2C Controller #0 + 082d Medfield Serial IO I2C Controller #1 + 082e Medfield Serial IO I2C Controller #2 0885 Centrino Wireless-N + WiMAX 6150 8086 1305 Centrino Wireless-N + WiMAX 6150 BGN 8086 1307 Centrino Wireless-N + WiMAX 6150 BG @@ -22445,6 +22507,18 @@ 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller 8086 1161 82806AA PCI64 Hub APIC 1162 Xscale 80200 Big Endian Companion Chip + 1190 Merrifield SD/SDIO/eMMC Controller + 1191 Merrifield Serial IO HSUART Controller + 1192 Merrifield Serial IO HSUART DMA Controller + 1194 Merrifield Serial IO SPI Controller + 1195 Merrifield Serial IO I2C Controller + 1196 Merrifield Serial IO I2C Controller + 1199 Merrifield GPIO Controller + 119e Merrifield USB Device Controller (OTG) + 11a0 Merrifield SCU IPC + 11a1 Merrifield Power Management Unit + 11a2 Merrifield Serial IO DMA Controller + 11a5 Merrifield Serial IO PWM Controller 1200 IXP1200 Network Processor 172a 0000 AEP SSL Accelerator 1209 8255xER/82551IT Fast Ethernet Controller @@ -22917,8 +22991,8 @@ 103c 0000 HPE Ethernet 10/20Gb 2-port 660FLB Adapter 103c 22fe HPE Ethernet 10/20Gb 2-port 660FLB Adapter 1588 Ethernet Controller XL710 for 20GbE backplane - 103c 0000 HPE Ethernet 10/20Gb 2-port 660M Adapter - 103c 22ff HPE Ethernet 10/20Gb 2-port 660M Adapter + 103c 0000 Ethernet 10/20Gb 2-port 660M Adapter + 103c 22ff Ethernet 10/20Gb 2-port 660M Adapter 1589 Ethernet Controller X710/X557-AT 10GBASE-T 108e 0000 Quad Port 10GBase-T Adapter 108e 7b1c Quad Port 10GBase-T Adapter @@ -22951,12 +23025,17 @@ 15ac Ethernet Connection X552 10 GbE SFP+ 15ad Ethernet Connection X552/X557-AT 10GBASE-T 15ae Ethernet Connection X552 1000BASE-T + 15b0 Ethernet Connection X552 Backplane 15b4 X553 Virtual Function 15b5 DSL6340 USB 3.1 Controller [Alpine Ridge] 15b6 DSL6540 USB 3.1 Controller [Alpine Ridge] 15b7 Ethernet Connection (2) I219-LM 15b8 Ethernet Connection (2) I219-V 15b9 Ethernet Connection (3) I219-LM + 15bb Ethernet Connection (7) I219-LM + 15bc Ethernet Connection (7) I219-V + 15bd Ethernet Connection (6) I219-LM + 15be Ethernet Connection (6) I219-V 15bf JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] 15c0 JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] 15c5 X553 Virtual Function @@ -24258,6 +24337,9 @@ 24f4 Wireless 8260 # Snow Field Peak AC 8086 0030 Dual Band Wireless-AC 8260 + 24fd Wireless 8265 / 8275 +# Windstorm Peak + 8086 0010 Dual Band Wireless-AC 8265 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -25145,12 +25227,12 @@ 1028 01da OptiPlex 745 1462 7235 P965 Neo MS-7235 mainboard 2826 C600/X79 series chipset SATA RAID Controller - 1d49 0100 ThinkSystem RAID 331 - 1d49 0101 ThinkSystem RAID 331 - 1d49 0102 ThinkSystem RAID 331 - 1d49 0103 ThinkSystem RAID 331 - 1d49 0104 ThinkSystem RAID 331 - 1d49 0105 ThinkSystem RAID 331 + 1d49 0100 Intel RSTe SATA Software RAID + 1d49 0101 Intel RSTe SATA Software RAID + 1d49 0102 Intel RSTe SATA Software RAID + 1d49 0103 Intel RSTe SATA Software RAID + 1d49 0104 Intel RSTe SATA Software RAID + 1d49 0105 Intel RSTe SATA Software RAID 2827 C610/X99 series chipset sSATA Controller [RAID mode] 2828 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [IDE mode] 1028 01f3 Inspiron 1420 @@ -26950,41 +27032,41 @@ 530d 80310 (IOP) IO Processor 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine - 5a84 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Graphics Controller - 5a88 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Imaging Unit - 5a98 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Audio Cluster - 5a9a Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Trusted Execution Engine - 5aa2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Integrated Sensor Hub - 5aa8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series USB xHCI - 5aac Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #1 - 5aae Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #2 - 5ab0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #3 - 5ab2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #4 - 5ab4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #5 - 5ab6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #6 - 5ab8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #7 - 5aba Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series I2C Controller #8 - 5abc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #1 - 5abe Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #2 - 5ac0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #3 - 5ac2 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #1 - 5ac4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #2 - 5ac6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SPI Controller #3 - 5ac8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PWM Pin Controller - 5aca Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDXC/MMC Host Controller - 5acc Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series eMMC Controller - 5ad0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SDIO Controller - 5ad4 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SMBus Controller - 5ad6 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #1 - 5ad7 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port B #2 - 5ad8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #1 - 5ad9 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #2 - 5ada Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #3 - 5adb Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series PCI Express Port A #4 - 5ae3 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series SATA AHCI Controller - 5ae8 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Low Pin Count Interface - 5aee Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series HSUART Controller #4 - 5af0 Atom/Celeron/Pentium Processor N4200/N3350/E3900 Series Host Bridge + 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller + 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit + 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster + 5a9a Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine + 5aa2 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Sensor Hub + 5aa8 Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI + 5aac Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 + 5aae Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #2 + 5ab0 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #3 + 5ab2 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #4 + 5ab4 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 + 5ab6 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #6 + 5ab8 Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #7 + 5aba Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #8 + 5abc Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #1 + 5abe Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #2 + 5ac0 Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #3 + 5ac2 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #1 + 5ac4 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #2 + 5ac6 Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #3 + 5ac8 Celeron N3350/Pentium N4200/Atom E3900 Series PWM Pin Controller + 5aca Celeron N3350/Pentium N4200/Atom E3900 Series SDXC/MMC Host Controller + 5acc Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller + 5ad0 Celeron N3350/Pentium N4200/Atom E3900 Series SDIO Controller + 5ad4 Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller + 5ad6 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #1 + 5ad7 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #2 + 5ad8 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #1 + 5ad9 Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #2 + 5ada Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #3 + 5adb Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #4 + 5ae3 Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller + 5ae8 Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface + 5aee Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #4 + 5af0 Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge 65c0 5100 Chipset Memory Controller Hub 65e2 5100 Chipset PCI Express x4 Port 2 65e3 5100 Chipset PCI Express x4 Port 3 @@ -27826,6 +27908,25 @@ a243 Lewisburg LPC or eSPI Controller a252 Lewisburg SSATA Controller [AHCI mode] a256 Lewisburg SSATA Controller [RAID mode] + a282 200 Series PCH SATA controller [AHCI mode] + a294 200 Series PCH PCI Express Root Port #1 + a2a1 200 Series PCH PMC + a2a3 200 Series PCH SMBus Controller + a2a7 200 Series PCH Serial IO UART Controller #0 + a2a8 200 Series PCH Serial IO UART Controller #1 + a2a9 200 Series PCH Serial IO SPI Controller #0 + a2aa 200 Series PCH Serial IO SPI Controller #1 + a2af 200 Series PCH USB 3.0 xHCI Controller + a2b1 200 Series PCH Thermal Subsystem + a2ba 200 Series PCH CSME HECI #1 + a2bb 200 Series PCH CSME HECI #2 + a2c6 200 Series PCH LPC Controller + a2e0 200 Series PCH Serial IO I2C Controller #0 + a2e1 200 Series PCH Serial IO I2C Controller #1 + a2e2 200 Series PCH Serial IO I2C Controller #2 + a2e3 200 Series PCH Serial IO I2C Controller #3 + a2e6 200 Series PCH Serial IO UART Controller #2 + a2f0 200 Series PCH HD Audio a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series b152 21152 PCI-to-PCI Bridge @@ -28605,6 +28706,7 @@ f1d0 AJA Video cafe Kona SD cfee Xena LS/SD-22-DA/SD-DA daff KONA LHi + db09 Corvid 24 dcaf Kona HD dfee Xena HD-DA efac Xena SD-MM/SD-22-MM From owner-svn-src-stable-10@freebsd.org Thu Jan 12 01:20:52 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9643DCAA480; Thu, 12 Jan 2017 01:20:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6437818EF; Thu, 12 Jan 2017 01:20:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0C1KpuH074517; Thu, 12 Jan 2017 01:20:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0C1Kpg7074515; Thu, 12 Jan 2017 01:20:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701120120.v0C1Kpg7074515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Jan 2017 01:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311959 - in stable/10/sys: compat/freebsd32 kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 01:20:52 -0000 Author: kib Date: Thu Jan 12 01:20:51 2017 New Revision: 311959 URL: https://svnweb.freebsd.org/changeset/base/311959 Log: MFC r311447: Some style fixes for getfstat(2)-related code. Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 01:13:05 2017 (r311958) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 12 01:20:51 2017 (r311959) @@ -244,7 +244,8 @@ copy_statfs(struct statfs *in, struct st #ifdef COMPAT_FREEBSD4 int -freebsd4_freebsd32_getfsstat(struct thread *td, struct freebsd4_freebsd32_getfsstat_args *uap) +freebsd4_freebsd32_getfsstat(struct thread *td, + struct freebsd4_freebsd32_getfsstat_args *uap) { struct statfs *buf, *sp; struct statfs32 stat32; Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Thu Jan 12 01:13:05 2017 (r311958) +++ stable/10/sys/kern/vfs_syscalls.c Thu Jan 12 01:20:51 2017 (r311959) @@ -464,7 +464,7 @@ kern_getfsstat(struct thread *td, struct nmp = TAILQ_NEXT(mp, mnt_list); continue; } - if (sfsp && count < maxcount) { + if (sfsp != NULL && count < maxcount) { sp = &mp->mnt_stat; /* * Set these in case the underlying filesystem @@ -509,7 +509,7 @@ kern_getfsstat(struct thread *td, struct vfs_unbusy(mp); } mtx_unlock(&mountlist_mtx); - if (sfsp && count > maxcount) + if (sfsp != NULL && count > maxcount) td->td_retval[0] = maxcount; else td->td_retval[0] = count; From owner-svn-src-stable-10@freebsd.org Thu Jan 12 21:46:32 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5E91CAD505; Thu, 12 Jan 2017 21:46:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 953AC1992; Thu, 12 Jan 2017 21:46:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0CLkVX9082975; Thu, 12 Jan 2017 21:46:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CLkVQo082974; Thu, 12 Jan 2017 21:46:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701122146.v0CLkVQo082974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Jan 2017 21:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311998 - stable/10/bin/ls/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 21:46:32 -0000 Author: asomers Date: Thu Jan 12 21:46:31 2017 New Revision: 311998 URL: https://svnweb.freebsd.org/changeset/base/311998 Log: MFC r310118 Fix ls_tests:o_flag with ZFS TMPDIR Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is updated. The test must explicitly clear uarch to be portable across filesystems. Also, it doesn't need to run as root. Modified: stable/10/bin/ls/tests/ls_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ls/tests/ls_tests.sh ============================================================================== --- stable/10/bin/ls/tests/ls_tests.sh Thu Jan 12 21:41:00 2017 (r311997) +++ stable/10/bin/ls/tests/ls_tests.sh Thu Jan 12 21:46:31 2017 (r311998) @@ -689,7 +689,6 @@ atf_test_case o_flag o_flag_head() { atf_set "descr" "Verify that the output from ls -o prints out the chflag values or '-' if none are set" - atf_set "require.user" "root" } o_flag_body() @@ -703,6 +702,7 @@ o_flag_body() atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \ bs=$size count=1 atf_check -e empty -o empty -s exit:0 chflags uarch a.file + atf_check -e empty -o empty -s exit:0 chflags 0 b.file atf_check -e empty -o match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \ -s exit:0 ls -lo a.file From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:24:43 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24B5CCADD7D; Fri, 13 Jan 2017 08:24:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA03F1B09; Fri, 13 Jan 2017 08:24:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8Of7I044685; Fri, 13 Jan 2017 08:24:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8OfKb044684; Fri, 13 Jan 2017 08:24:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130824.v0D8OfKb044684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312021 - stable/10/usr.bin/top X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:24:43 -0000 Author: ngie Date: Fri Jan 13 08:24:41 2017 New Revision: 312021 URL: https://svnweb.freebsd.org/changeset/base/312021 Log: MFC r266773,r280680,r311710: r266773 (by jhb): Fix a couple of size_t != int warnings. r280680 (by kevlo): Print size_t's with %zu rather than "%zd. r311710: Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length Modified: stable/10/usr.bin/top/machine.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/top/machine.c ============================================================================== --- stable/10/usr.bin/top/machine.c Fri Jan 13 08:19:52 2017 (r312020) +++ stable/10/usr.bin/top/machine.c Fri Jan 13 08:24:41 2017 (r312021) @@ -363,7 +363,7 @@ machine_init(struct statics *statics, ch size = sizeof(long) * maxcpu * CPUSTATES; times = malloc(size); if (times == NULL) - err(1, "malloc %zd bytes", size); + err(1, "malloc %zu bytes", size); if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); pcpu_cp_time = calloc(1, size); @@ -396,7 +396,7 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; - + if (ps.jail) jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ else @@ -536,7 +536,7 @@ get_system_info(struct system_info *si) arc_stats[5] = arc_stat >> 10; si->arc = arc_stats; } - + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -562,7 +562,7 @@ get_system_info(struct system_info *si) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + if (sysctl(mib, nitems(mib), &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { @@ -917,7 +917,7 @@ format_next_process(caddr_t handle, char argbuflen = cmdlen * 4; argbuf = (char *)malloc(argbuflen + 1); if (argbuf == NULL) { - warn("malloc(%d)", argbuflen + 1); + warn("malloc(%zu)", argbuflen + 1); free(cmdbuf); return NULL; } @@ -970,7 +970,7 @@ format_next_process(caddr_t handle, char } } - if (ps.jail == 0) + if (ps.jail == 0) jid_buf[0] = '\0'; else snprintf(jid_buf, sizeof(jid_buf), "%*d", @@ -1026,7 +1026,7 @@ format_next_process(caddr_t handle, char thr_buf[0] = '\0'; else snprintf(thr_buf, sizeof(thr_buf), "%*d ", - sizeof(thr_buf) - 2, pp->ki_numthreads); + (int)(sizeof(thr_buf) - 2), pp->ki_numthreads); snprintf(fmt, sizeof(fmt), proc_fmt, pp->ki_pid, From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:27:41 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D55C0CADFE1; Fri, 13 Jan 2017 08:27:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFBCA1EC5; Fri, 13 Jan 2017 08:27:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8ReAM044966; Fri, 13 Jan 2017 08:27:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8ReiR044965; Fri, 13 Jan 2017 08:27:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130827.v0D8ReiR044965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312023 - stable/10/usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:27:41 -0000 Author: ngie Date: Fri Jan 13 08:27:40 2017 New Revision: 312023 URL: https://svnweb.freebsd.org/changeset/base/312023 Log: MFC r311711,r311712,r311713: r311711: Clean up trailing whitespace r311712: Sort #includes r311713: Use nitems(mib) instead of hardcoding mib's length Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Fri Jan 13 08:27:07 2017 (r312022) +++ stable/10/usr.sbin/route6d/route6d.c Fri Jan 13 08:27:40 2017 (r312023) @@ -4,7 +4,7 @@ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -34,34 +34,13 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; #endif -#include - -#include -#include -#include -#include -#include -#include -#ifdef __STDC__ -#include -#else -#include -#endif -#include -#include -#include -#include -#ifdef HAVE_POLL_H -#include -#endif - -#include #include #include -#include #include +#include #include #include +#include #include #include #include @@ -69,10 +48,27 @@ static const char _rcsid[] = "$KAME: rou #include #include #include -#include +#include +#include +#include #include - -#include +#include +#ifdef HAVE_POLL_H +#include +#endif +#include +#include +#ifdef __STDC__ +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include #include "route6d.h" @@ -107,7 +103,7 @@ struct ifc { /* Configuration of an in }; TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); -struct ifac { /* Adddress associated to an interface */ +struct ifac { /* Adddress associated to an interface */ TAILQ_ENTRY(ifac) ifac_next; struct ifc *ifac_ifc; /* back pointer */ @@ -674,7 +670,7 @@ init(void) fatal("rip IPV6_PKTINFO"); /*NOTREACHED*/ } -#endif +#endif #ifdef IPV6_RECVPKTINFO if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, @@ -820,8 +816,8 @@ ripsend(struct ifc *ifcp, struct sockadd * Request from non-link local address is not * a regular route6d update. */ - maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); nh = NULL; @@ -869,8 +865,8 @@ ripsend(struct ifc *ifcp, struct sockadd return; } - maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); @@ -954,13 +950,13 @@ out_filter(struct riprt *rrt, struct ifc /* * -A: filter out less specific routes, if we have aggregated * route configured. - */ + */ TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { if (iffp->iff_type != 'A') continue; if (rrt->rrt_info.rip6_plen <= iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) return 0; @@ -996,7 +992,7 @@ out_filter(struct riprt *rrt, struct ifc continue; if (rrt->rrt_info.rip6_plen < iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1196,8 +1192,8 @@ riprecv(void) } else { riprequest(NULL, np, nn, &fsock); } - return; - } + return; + } if (!IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) { trace(1, "Response from non-ll addr: %s\n", @@ -1224,7 +1220,7 @@ riprecv(void) * source address to be forwarded to a different link. * So we also check whether the destination address is a link-local * address or the hop limit is 255. Note that RFC2080 does not require - * the specific hop limit for a unicast response, so we cannot assume + * the specific hop limit for a unicast response, so we cannot assume * the limitation. */ if (!IN6_IS_ADDR_LINKLOCAL(&pi->ipi6_addr) && *hlimp != 255) { @@ -1246,7 +1242,7 @@ riprecv(void) return; /* The packet is from me; ignore */ if (rp->rip6_cmd != RIP6_RESPONSE) { trace(1, "Invalid command %d\n", rp->rip6_cmd); - return; + return; } /* -N: no use */ @@ -1324,7 +1320,7 @@ riprecv(void) /* special rule: ::/0 means default, not "in /0" */ if (iffp->iff_plen == 0 && np->rip6_plen > 0) continue; - ia = np->rip6_dest; + ia = np->rip6_dest; applyplen(&ia, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { ok = 1; @@ -1375,7 +1371,7 @@ riprecv(void) } else if (nq->rip6_metric == np->rip6_metric && np->rip6_metric < HOPCNT_INFINITY6) { if (rrt->rrt_index == ifcp->ifc_index && - IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { + IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) { /* same metric, same route from same gw */ rrt->rrt_t = t; } else if (rrt->rrt_t < t_half_lifetime) { @@ -1390,7 +1386,7 @@ riprecv(void) rrt->rrt_t = t; } } - /* + /* * if nq->rip6_metric == HOPCNT_INFINITY6 then * do not update age value. Do nothing. */ @@ -1668,7 +1664,7 @@ ifremove(int ifindex) break; } if (ifcp == NULL) - return; + return; tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name); TAILQ_REMOVE(&ifc_head, ifcp, ifc_next); @@ -1825,7 +1821,7 @@ rtrecv(void) #if 0 if (rta[RTAX_DST] == NULL) { trace(1, "\tno destination, ignored\n"); - continue; + continue; } if (rta[RTAX_DST]->sin6_family != AF_INET6) { trace(1, "\taf mismatch, ignored\n"); @@ -2423,7 +2419,7 @@ getifmtu(int ifindex) mib[3] = AF_INET6; mib[4] = NET_RT_IFLIST; mib[5] = ifindex; - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { fatal("sysctl estimate NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2431,7 +2427,7 @@ getifmtu(int ifindex) fatal("malloc"); /*NOTREACHED*/ } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { fatal("sysctl NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2606,7 +2602,7 @@ krtread(int again) free(buf); buf = NULL; } - if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; } @@ -2614,7 +2610,7 @@ krtread(int again) errmsg = "malloc"; continue; } - if (sysctl(mib, 6, buf, &msize, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &msize, NULL, 0) < 0) { errmsg = "sysctl NET_RT_DUMP"; continue; } @@ -3242,7 +3238,7 @@ ifonly: #if 0 /* * When the address has already been registered in the - * kernel routing table, it should be removed + * kernel routing table, it should be removed */ delroute(&rrt->rrt_info, &gw); #else @@ -3323,7 +3319,7 @@ mask2len(const struct in6_addr *addr, in { int i = 0, j; const u_char *p = (const u_char *)addr; - + for (j = 0; j < lenlim; j++, p++) { if (*p != 0xff) break; @@ -3450,7 +3446,7 @@ ripsuptrig(void) time_t t; double r = rand(); - t = (int)(RIP_TRIG_INT6_MIN + + t = (int)(RIP_TRIG_INT6_MIN + (RIP_TRIG_INT6_MAX - RIP_TRIG_INT6_MIN) * (r / RAND_MAX)); sup_trig_update = time(NULL) + t; return t; From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:29:44 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D0FCA5183; Fri, 13 Jan 2017 08:29:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79DA510DF; Fri, 13 Jan 2017 08:29:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8ThNw045156; Fri, 13 Jan 2017 08:29:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8Th3J045155; Fri, 13 Jan 2017 08:29:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130829.v0D8Th3J045155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312025 - stable/10/tools/tools/gensnmpdef X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:29:44 -0000 Author: ngie Date: Fri Jan 13 08:29:43 2017 New Revision: 312025 URL: https://svnweb.freebsd.org/changeset/base/312025 Log: MFC r311511: Add integration makefile for contrib/bsnmp/gensnmpdef It's a whole lot less error prone than generating the file completely by hand. Added: stable/10/tools/tools/gensnmpdef/ - copied from r311511, head/tools/tools/gensnmpdef/ Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:36:16 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E7FCA55EF; Fri, 13 Jan 2017 08:36:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009E71A6E; Fri, 13 Jan 2017 08:36:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8aFRF049264; Fri, 13 Jan 2017 08:36:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8aFvx049263; Fri, 13 Jan 2017 08:36:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130836.v0D8aFvx049263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312028 - stable/10/contrib/netbsd-tests/lib/libc/ttyio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:36:16 -0000 Author: ngie Date: Fri Jan 13 08:36:14 2017 New Revision: 312028 URL: https://svnweb.freebsd.org/changeset/base/312028 Log: MFC r311871: Merge ^/vendor/NetBSD/tests/dist@r311868 This is the vendor accepted version of ^/head@r311245 Modified: stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Fri Jan 13 08:35:01 2017 (r312027) +++ stable/10/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c Fri Jan 13 08:36:14 2017 (r312028) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */ +/* $NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $ */ /* * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $"); +__RCSID("$NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $"); #include #include @@ -150,11 +150,9 @@ ATF_TC_BODY(ioctl, tc) /* wait for last child */ sa.sa_handler = SIG_DFL; REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1); - (void) wait(NULL); + (void)wait(NULL); -#ifdef __FreeBSD__ (void)close(s); -#endif ATF_REQUIRE_EQ(rc, 0); } From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:38:31 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10ADDCA579E; Fri, 13 Jan 2017 08:38:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D44A01F9F; Fri, 13 Jan 2017 08:38:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8cUIT049775; Fri, 13 Jan 2017 08:38:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8cUgp049774; Fri, 13 Jan 2017 08:38:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130838.v0D8cUgp049774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312030 - stable/10/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:38:31 -0000 Author: ngie Date: Fri Jan 13 08:38:29 2017 New Revision: 312030 URL: https://svnweb.freebsd.org/changeset/base/312030 Log: MFC r311870: Merge the grammar fix for lib/libc/gen/raise_test:raise_stress Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c Fri Jan 13 08:37:39 2017 (r312029) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c Fri Jan 13 08:38:29 2017 (r312030) @@ -1,4 +1,4 @@ -/* $NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */ +/* $NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $"); +__RCSID("$NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $"); #include @@ -180,7 +180,7 @@ ATF_TC_BODY(raise_stress, tc) (void)raise(SIGUSR1); if (count != maxiter) - atf_tc_fail("not all signals were catched"); + atf_tc_fail("not all signals were caught"); } ATF_TP_ADD_TCS(tp) From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:39:41 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D241BCA58B2; Fri, 13 Jan 2017 08:39:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACB7E124D; Fri, 13 Jan 2017 08:39:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8deu9049953; Fri, 13 Jan 2017 08:39:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8def3049949; Fri, 13 Jan 2017 08:39:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130839.v0D8def3049949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312032 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:39:41 -0000 Author: ngie Date: Fri Jan 13 08:39:40 2017 New Revision: 312032 URL: https://svnweb.freebsd.org/changeset/base/312032 Log: MFC r311714: lib/libutil/kinfo_*: style cleanup - Use nitems(mib) instead of hardcoding mib's length - Sort sys/ #includes Modified: stable/10/lib/libutil/kinfo_getallproc.c stable/10/lib/libutil/kinfo_getfile.c stable/10/lib/libutil/kinfo_getproc.c stable/10/lib/libutil/kinfo_getvmmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/kinfo_getallproc.c ============================================================================== --- stable/10/lib/libutil/kinfo_getallproc.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getallproc.c Fri Jan 13 08:39:40 2017 (r312032) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -75,14 +75,14 @@ kinfo_getallproc(int *cntp) mib[2] = KERN_PROC_PROC; len = 0; - if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 3, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len % sizeof(*kipp) != 0) goto bad; Modified: stable/10/lib/libutil/kinfo_getfile.c ============================================================================== --- stable/10/lib/libutil/kinfo_getfile.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getfile.c Fri Jan 13 08:39:40 2017 (r312032) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getfile(pid_t pid, int *cntp) mib[2] = KERN_PROC_FILEDESC; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); Modified: stable/10/lib/libutil/kinfo_getproc.c ============================================================================== --- stable/10/lib/libutil/kinfo_getproc.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getproc.c Fri Jan 13 08:39:40 2017 (r312032) @@ -30,8 +30,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -49,14 +49,14 @@ kinfo_getproc(pid_t pid) mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = pid; - if (sysctl(mib, 4, NULL, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 4, kipp, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) goto bad; if (len != sizeof(*kipp)) goto bad; Modified: stable/10/lib/libutil/kinfo_getvmmap.c ============================================================================== --- stable/10/lib/libutil/kinfo_getvmmap.c Fri Jan 13 08:39:23 2017 (r312031) +++ stable/10/lib/libutil/kinfo_getvmmap.c Fri Jan 13 08:39:40 2017 (r312032) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getvmmap(pid_t pid, int *cntp) mib[2] = KERN_PROC_VMMAP; mib[3] = pid; - error = sysctl(mib, 4, NULL, &len, NULL, 0); + error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, &len, NULL, 0); + error = sysctl(mib, nitems(mib), buf, &len, NULL, 0); if (error) { free(buf); return (NULL); From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:41:00 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25D9DCA5AD8; Fri, 13 Jan 2017 08:41:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7300177A; Fri, 13 Jan 2017 08:40:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8exaO051650; Fri, 13 Jan 2017 08:40:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8extn051649; Fri, 13 Jan 2017 08:40:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130840.v0D8extn051649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312034 - stable/10/usr.sbin/rwhod X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:41:00 -0000 Author: ngie Date: Fri Jan 13 08:40:58 2017 New Revision: 312034 URL: https://svnweb.freebsd.org/changeset/base/312034 Log: MFC r311709: Style(9) fixes - Sort sys/ #includes - Use nitems instead of hardcoding the length of `mib` Modified: stable/10/usr.sbin/rwhod/rwhod.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rwhod/rwhod.c ============================================================================== --- stable/10/usr.sbin/rwhod/rwhod.c Fri Jan 13 08:40:53 2017 (r312033) +++ stable/10/usr.sbin/rwhod/rwhod.c Fri Jan 13 08:40:58 2017 (r312034) @@ -43,14 +43,14 @@ static char sccsid[] = "@(#)rwhod.c 8.1 #include __FBSDID("$FreeBSD$"); -#include #include +#include +#include +#include #include #include #include -#include #include -#include #include #include @@ -549,7 +549,7 @@ getboottime(int signo __unused) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(tm); - if (sysctl(mib, 2, &tm, &size, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), &tm, &size, NULL, 0) == -1) { syslog(LOG_ERR, "cannot get boottime: %m"); exit(1); } @@ -630,11 +630,11 @@ configure(int so) mib[3] = AF_INET; mib[4] = NET_RT_IFLIST; mib[5] = 0; - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) quit("route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) quit("malloc"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) quit("actual retrieval of interface table"); lim = buf + needed; From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:42:12 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5B45CA5DA6; Fri, 13 Jan 2017 08:42:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66F4B1CE8; Fri, 13 Jan 2017 08:42:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8gBM8053912; Fri, 13 Jan 2017 08:42:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8gBsJ053911; Fri, 13 Jan 2017 08:42:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130842.v0D8gBsJ053911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312036 - stable/10/lib/libprocstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:42:12 -0000 Author: ngie Date: Fri Jan 13 08:42:11 2017 New Revision: 312036 URL: https://svnweb.freebsd.org/changeset/base/312036 Log: MFC r311715: Use nitems({mib,name}) instead of hardcoding their value Modified: stable/10/lib/libprocstat/libprocstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libprocstat/libprocstat.c ============================================================================== --- stable/10/lib/libprocstat/libprocstat.c Fri Jan 13 08:42:05 2017 (r312035) +++ stable/10/lib/libprocstat/libprocstat.c Fri Jan 13 08:42:11 2017 (r312036) @@ -282,7 +282,7 @@ procstat_getprocs(struct procstat *procs name[1] = KERN_PROC; name[2] = what; name[3] = arg; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); goto fail; @@ -299,7 +299,7 @@ procstat_getprocs(struct procstat *procs goto fail; } olen = len; - error = sysctl(name, 4, p, &len, NULL, 0); + error = sysctl(name, nitems(name), p, &len, NULL, 0); } while (error < 0 && errno == ENOMEM && olen == len); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); @@ -1760,7 +1760,7 @@ getargv(struct procstat *procstat, struc name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; name[3] = kp->ki_pid; len = nchr; - error = sysctl(name, 4, av->buf, &len, NULL, 0); + error = sysctl(name, nitems(name), av->buf, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl(kern.proc.%s)", env ? "env" : "args"); if (error != 0 || len == 0) @@ -1983,7 +1983,7 @@ procstat_getgroups_sysctl(pid_t pid, uns warn("malloc(%zu)", len); return (NULL); } - if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), groups, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.groups: %d", pid); free(groups); return (NULL); @@ -2059,7 +2059,7 @@ procstat_getumask_sysctl(pid_t pid, unsi mib[2] = KERN_PROC_UMASK; mib[3] = pid; len = sizeof(*maskp); - error = sysctl(mib, 4, maskp, &len, NULL, 0); + error = sysctl(mib, nitems(mib), maskp, &len, NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.umask: %d", pid); return (error); @@ -2139,7 +2139,7 @@ procstat_getrlimit_sysctl(pid_t pid, int name[3] = pid; name[4] = which; len = sizeof(struct rlimit); - error = sysctl(name, 5, rlimit, &len, NULL, 0); + error = sysctl(name, nitems(name), rlimit, &len, NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.rlimit: %d", pid); return (-1); @@ -2201,7 +2201,7 @@ procstat_getpathname_sysctl(pid_t pid, c name[2] = KERN_PROC_PATHNAME; name[3] = pid; len = maxlen; - error = sysctl(name, 4, pathname, &len, NULL, 0); + error = sysctl(name, nitems(name), pathname, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.pathname: %d", pid); if (len == 0) @@ -2281,7 +2281,7 @@ procstat_getosrel_sysctl(pid_t pid, int name[2] = KERN_PROC_OSREL; name[3] = pid; len = sizeof(*osrelp); - error = sysctl(name, 4, osrelp, &len, NULL, 0); + error = sysctl(name, nitems(name), osrelp, &len, NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.osrel: %d", pid); return (error); @@ -2341,7 +2341,7 @@ is_elf32_sysctl(pid_t pid) name[2] = KERN_PROC_SV_NAME; name[3] = pid; len = sizeof(sv_name); - error = sysctl(name, 4, sv_name, &len, NULL, 0); + error = sysctl(name, nitems(name), sv_name, &len, NULL, 0); if (error != 0 || len == 0) return (0); for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { @@ -2372,7 +2372,7 @@ procstat_getauxv32_sysctl(pid_t pid, uns warn("malloc(%zu)", len); goto out; } - if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv32, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); goto out; @@ -2421,7 +2421,7 @@ procstat_getauxv_sysctl(pid_t pid, unsig warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv, &len, NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); free(auxv); @@ -2482,7 +2482,7 @@ procstat_getkstack_sysctl(pid_t pid, int name[3] = pid; len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); if (error < 0 && errno != ESRCH && errno != EPERM && errno != ENOENT) { warn("sysctl: kern.proc.kstack: %d", pid); return (NULL); @@ -2499,7 +2499,7 @@ procstat_getkstack_sysctl(pid_t pid, int warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, kkstp, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), kkstp, &len, NULL, 0) == -1) { warn("sysctl: kern.proc.pid: %d", pid); free(kkstp); return (NULL); From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:46:50 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C849CAB063; Fri, 13 Jan 2017 08:46:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63F8F12BF; Fri, 13 Jan 2017 08:46:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8knWr054384; Fri, 13 Jan 2017 08:46:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8knFJ054382; Fri, 13 Jan 2017 08:46:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130846.v0D8knFJ054382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312038 - stable/10/contrib/netbsd-tests/lib/libpthread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:46:50 -0000 Author: ngie Date: Fri Jan 13 08:46:49 2017 New Revision: 312038 URL: https://svnweb.freebsd.org/changeset/base/312038 Log: MFC r311265,r311274: r311265: fpu: ensure calls to pthread_create succeed and test sched_yield to make sure it returns 0 sched_yield tests for values returning 0 of type int and sched_yield is of type long, so the test is a mismatch CID: 1254953, 1254954, 1254965, 1254966 r311274: run: ensure pthread_condattr_{init,setclock} is successful CID: 1268631, 1268633 Modified: stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c Fri Jan 13 08:46:46 2017 (r312037) +++ stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c Fri Jan 13 08:46:49 2017 (r312038) @@ -42,6 +42,8 @@ __RCSID("$NetBSD: t_condwait.c,v 1.4 201 #ifdef __FreeBSD__ #include + +#include "h_common.h" #endif #define WAITTIME 2 /* Timeout wait secound */ @@ -60,8 +62,13 @@ run(void *param) clck = *(clockid_t *)param; +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_condattr_init(&attr)); + PTHREAD_REQUIRE(pthread_condattr_setclock(&attr, clck)); +#else pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, clck); /* MONOTONIC or MONOTONIC */ +#endif pthread_cond_init(&cond, &attr); ATF_REQUIRE_EQ((ret = pthread_mutex_lock(&m)), 0); Modified: stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c Fri Jan 13 08:46:46 2017 (r312037) +++ stable/10/contrib/netbsd-tests/lib/libpthread/t_fpu.c Fri Jan 13 08:46:49 2017 (r312038) @@ -58,6 +58,11 @@ __RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/ #include +#ifdef __FreeBSD__ +#include +#include +#endif + #include "h_common.h" #define N_RECURSE 10 @@ -77,14 +82,24 @@ stir(void *p) for (;;) { x = sin ((y = cos (x + y + .4)) - (z = cos (x + z + .6))); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); +#else PTHREAD_REQUIRE(sched_yield()); +#endif } } static double mul3(double x, double y, double z) { +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); +#else PTHREAD_REQUIRE(sched_yield()); +#endif return x * y * z; } @@ -114,7 +129,11 @@ bar(void *p) static void recurse(void) { pthread_t s2; +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_create(&s2, 0, bar, 0)); +#else pthread_create(&s2, 0, bar, 0); +#endif sleep(20); /* XXX must be long enough for our slowest machine */ } @@ -134,7 +153,11 @@ ATF_TC_BODY(fpu, tc) PTHREAD_REQUIRE(pthread_mutex_init(&recursion_depth_lock, 0)); +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_create(&s5, 0, stir, stirseed)); +#else pthread_create(&s5, 0, stir, stirseed); +#endif recurse(); atf_tc_fail("exiting from main"); From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:48:18 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0C58CAB16F; Fri, 13 Jan 2017 08:48:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B20CF1623; Fri, 13 Jan 2017 08:48:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8mHrR054519; Fri, 13 Jan 2017 08:48:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8mHFI054518; Fri, 13 Jan 2017 08:48:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130848.v0D8mHFI054518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312039 - stable/10/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:48:19 -0000 Author: ngie Date: Fri Jan 13 08:48:17 2017 New Revision: 312039 URL: https://svnweb.freebsd.org/changeset/base/312039 Log: MFC r311268: Clarify lifetime of child(..) function Ensure child exits when complete as it's always run in a forked process. Add a missing break statement in :pselect_sigmask when calling child(..) for clarity and to avoid weird domino effects if the child process somehow does something it's not supposed to do with the logfiles, file descriptors, etc CID: 1223369, 1223370, 1300301 Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c Fri Jan 13 08:46:49 2017 (r312038) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c Fri Jan 13 08:48:17 2017 (r312039) @@ -135,6 +135,9 @@ child(const struct timespec *ts) "after timeout %s != %s", prmask(&nset, nbuf, sizeof(nbuf)), prmask(&oset, obuf, sizeof(obuf))); +#ifdef __FreeBSD__ + _exit(0); +#endif } ATF_TC(pselect_sigmask); @@ -154,6 +157,9 @@ ATF_TC_BODY(pselect_sigmask, tc) switch (pid = fork()) { case 0: child(NULL); +#ifdef __FreeBSD__ + break; +#endif case -1: err(1, "fork"); default: From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:49:24 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03A67CAB2E1; Fri, 13 Jan 2017 08:49:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C63D219F6; Fri, 13 Jan 2017 08:49:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8nN7C054738; Fri, 13 Jan 2017 08:49:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8nNWO054737; Fri, 13 Jan 2017 08:49:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130849.v0D8nNWO054737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312042 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:49:24 -0000 Author: ngie Date: Fri Jan 13 08:49:22 2017 New Revision: 312042 URL: https://svnweb.freebsd.org/changeset/base/312042 Log: MFC r311282: snmp_mibII(3) requires net/if.h and net/if_mib.h Document that requirement Modified: stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Fri Jan 13 08:49:10 2017 (r312041) +++ stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Fri Jan 13 08:49:22 2017 (r312042) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmp_mibII/snmp_mibII.3,v 1.10 2005/10/04 08:46:52 brandt_h Exp $ .\" -.Dd October 4, 2005 +.Dd January 4, 2017 .Dt SNMP_MIBII 3 .Os .Sh NAME @@ -63,6 +63,8 @@ .Sh LIBRARY .Pq begemotSnmpdModulePath."mibII" = "@MODPATH@snmp_mibII.so" .Sh SYNOPSIS +.In net/if.h +.In net/if_mib.h .In bsnmp/snmpmod.h .In bsnmp/snmp_mibII.h .Ft typedef void From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:51:47 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B91CAB639; Fri, 13 Jan 2017 08:51:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF2D1E7D; Fri, 13 Jan 2017 08:51:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8pkEU057397; Fri, 13 Jan 2017 08:51:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8pkbl057396; Fri, 13 Jan 2017 08:51:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130851.v0D8pkbl057396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312044 - stable/10/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:51:47 -0000 Author: ngie Date: Fri Jan 13 08:51:46 2017 New Revision: 312044 URL: https://svnweb.freebsd.org/changeset/base/312044 Log: MFC r311290,r311293,r311294: r311290: Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name to avoid buffer overflows CID: 1006735, 1006737, 1006738 r311293: bridge_do_pfctl: allocate mib_name dynamically using asprintf This is being done to reduce wasted space, simplify complexity in the code, and to quell a Coverity warning about buffer overruns. warning about buffer overruns. CID: 1006736 r311294: style cleanup - bridge_pf_dump: use nitems instead of spelling it out longhand - bridge_do_pfctl: sort variables by alignment for type Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Fri Jan 13 08:51:43 2017 (r312043) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Fri Jan 13 08:51:46 2017 (r312044) @@ -485,7 +485,7 @@ bridge_set_if_up(const char* b_name, int struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { syslog(LOG_ERR, "set bridge up: ioctl(SIOCGIFFLAGS) " "failed: %s", strerror(errno)); @@ -516,7 +516,7 @@ bridge_create(const char *b_name) struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCIFCREATE, &ifr) < 0) { syslog(LOG_ERR, "create bridge: ioctl(SIOCIFCREATE) " @@ -549,7 +549,7 @@ bridge_destroy(const char *b_name) struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - strcpy(ifr.ifr_name, b_name); + strlcpy(ifr.ifr_name, b_name, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCIFDESTROY, &ifr) < 0) { syslog(LOG_ERR, "destroy bridge: ioctl(SIOCIFDESTROY) " @@ -1459,9 +1459,9 @@ bridge_get_pfval(uint8_t which) int32_t bridge_do_pfctl(int32_t bridge_ctl, enum snmp_op op, int32_t *val) { - char mib_name[100]; - int32_t i, s_i; + char *mib_oid; size_t len, s_len; + int32_t i, s_i; if (bridge_ctl >= LEAF_begemotBridgeLayer2PfStatus) return (-2); @@ -1474,19 +1474,24 @@ bridge_do_pfctl(int32_t bridge_ctl, enum len = sizeof(i); - strcpy(mib_name, bridge_sysctl); + asprintf(&mib_oid, "%s%s", bridge_sysctl, + bridge_pf_sysctl[bridge_ctl].name); + if (mib_oid == NULL) + return (-1); - if (sysctlbyname(strcat(mib_name, - bridge_pf_sysctl[bridge_ctl].name), &i, &len, - (op == SNMP_OP_SET ? &s_i : NULL), s_len) == -1) { - syslog(LOG_ERR, "sysctl(%s%s) failed - %s", bridge_sysctl, - bridge_pf_sysctl[bridge_ctl].name, strerror(errno)); + if (sysctlbyname(mib_oid, &i, &len, (op == SNMP_OP_SET ? &s_i : NULL), + s_len) == -1) { + syslog(LOG_ERR, "sysctl(%s) failed - %s", mib_oid, + strerror(errno)); + free(mib_oid); return (-1); } bridge_pf_sysctl[bridge_ctl].val = i; *val = i; + free(mib_oid); + return (i); } @@ -1495,8 +1500,7 @@ bridge_pf_dump(void) { uint8_t i; - for (i = 0; i < sizeof(bridge_pf_sysctl) / sizeof(bridge_pf_sysctl[0]); - i++) { + for (i = 0; i < nitems(bridge_pf_sysctl); i++) { syslog(LOG_ERR, "%s%s = %d", bridge_sysctl, bridge_pf_sysctl[i].name, bridge_pf_sysctl[i].val); } From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:54:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3629FCAB73E; Fri, 13 Jan 2017 08:54:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E03D31214; Fri, 13 Jan 2017 08:54:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8s7kp059156; Fri, 13 Jan 2017 08:54:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8s7At059155; Fri, 13 Jan 2017 08:54:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130854.v0D8s7At059155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312045 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:54:08 -0000 Author: ngie Date: Fri Jan 13 08:54:06 2017 New Revision: 312045 URL: https://svnweb.freebsd.org/changeset/base/312045 Log: MFC r311733: Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Fri Jan 13 08:51:46 2017 (r312044) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Fri Jan 13 08:54:06 2017 (r312045) @@ -319,7 +319,7 @@ fetch_generic_mib(struct mibif *ifp, con name[5] = IFDATA_GENERAL; len = sizeof(ifp->mib); - if (sysctl(name, 6, &ifp->mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &ifp->mib, &len, NULL, 0) == -1) { if (errno != ENOENT) syslog(LOG_WARNING, "sysctl(ifmib, %s) failed %m", ifp->name); @@ -480,7 +480,7 @@ mib_fetch_ifmib(struct mibif *ifp) name[3] = IFMIB_IFDATA; name[4] = ifp->sysindex; name[5] = IFDATA_LINKSPECIFIC; - if (sysctl(name, 6, NULL, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib estimate (%s): %m", ifp->name); if (ifp->specmib != NULL) { @@ -506,7 +506,7 @@ mib_fetch_ifmib(struct mibif *ifp) ifp->specmib = newmib; ifp->specmiblen = len; } - if (sysctl(name, 6, ifp->specmib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), ifp->specmib, &len, NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib (%s): %m", ifp->name); if (ifp->specmib != NULL) { ifp->specmib = NULL; @@ -902,7 +902,7 @@ mib_refresh_iflist(void) for (idx = 1; idx <= count; idx++) { name[4] = idx; len = sizeof(mib); - if (sysctl(name, 6, &mib, &len, NULL, 0) == -1) { + if (sysctl(name, nitems(name), &mib, &len, NULL, 0) == -1) { if (errno == ENOENT) continue; syslog(LOG_ERR, "ifmib(%u): %m", idx); @@ -1213,7 +1213,7 @@ mib_fetch_rtab(int af, int info, int arg *lenp = 0; /* initial estimate */ - if (sysctl(name, 6, NULL, lenp, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, lenp, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl estimate (%d,%d,%d,%d,%d,%d): %m", name[0], name[1], name[2], name[3], name[4], name[5]); return (NULL); @@ -1230,7 +1230,7 @@ mib_fetch_rtab(int af, int info, int arg } buf = newbuf; - if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) + if (sysctl(name, nitems(name), buf, lenp, NULL, 0) == 0) break; if (errno != ENOMEM) { From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:55:39 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FDACAB848; Fri, 13 Jan 2017 08:55:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDCCD156E; Fri, 13 Jan 2017 08:55:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8tcP0059363; Fri, 13 Jan 2017 08:55:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8tcOb059362; Fri, 13 Jan 2017 08:55:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130855.v0D8tcOb059362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312047 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:55:39 -0000 Author: ngie Date: Fri Jan 13 08:55:37 2017 New Revision: 312047 URL: https://svnweb.freebsd.org/changeset/base/312047 Log: MFC r310729: Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that could happen if a pdu was reused after calling the function, and as both stack and heap allocation types are used in contrib/bsnmp and usr.sbin/bsnmpd. snmp_value_free: NULL out value->v.octetstring.octets after calling free on it to prevent a double-free from occurring. Modified: stable/10/contrib/bsnmp/lib/snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.c Fri Jan 13 08:54:09 2017 (r312046) +++ stable/10/contrib/bsnmp/lib/snmp.c Fri Jan 13 08:55:37 2017 (r312047) @@ -1154,8 +1154,11 @@ snmp_pdu_dump(const struct snmp_pdu *pdu void snmp_value_free(struct snmp_value *value) { - if (value->syntax == SNMP_SYNTAX_OCTETSTRING) + + if (value->syntax == SNMP_SYNTAX_OCTETSTRING) { free(value->v.octetstring.octets); + value->v.octetstring.octets = NULL; + } value->syntax = SNMP_SYNTAX_NULL; } @@ -1216,6 +1219,7 @@ snmp_pdu_free(struct snmp_pdu *pdu) for (i = 0; i < pdu->nbindings; i++) snmp_value_free(&pdu->bindings[i]); + pdu->nbindings = 0; } /* From owner-svn-src-stable-10@freebsd.org Fri Jan 13 08:59:23 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 736FDCAB9C5; Fri, 13 Jan 2017 08:59:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 383E519A2; Fri, 13 Jan 2017 08:59:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8xMZb059758; Fri, 13 Jan 2017 08:59:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8xMGf059757; Fri, 13 Jan 2017 08:59:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130859.v0D8xMGf059757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312050 - stable/10/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:59:23 -0000 Author: ngie Date: Fri Jan 13 08:59:22 2017 New Revision: 312050 URL: https://svnweb.freebsd.org/changeset/base/312050 Log: MFC r310892,r310894,r310989: r310892: Don't call snmp_pdu_free(..) until finished with the pdu and when ready to allocate a new one via snmp_pdu_create(..) This fixes bsnmpwalk, so it no longer crashes after r310729 r310894: snmp_pdu_free the right object at the right time in snmptool_walk r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the process. - Call snmp_pdu_free on req before calling snmp_pdu_create on it at the bottom of the outer while loop - Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create in the inner loop r310989: Call snmp_pdu_free on req/resp with a consistent, correct pattern - snmp_pdu_free should be called before snmp_pdu_create is called again - snmp_pdu_free should be called on the resp to snmp_dialog when successful Tested with the following bsnmp commands: % export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0" % bsnmpset $SNMP_ARGS sysLocation="MyAgent" % bsnmpget $SNMP_ARGS sysLocation % bsnmpwalk $SNMP_ARGS Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Fri Jan 13 08:59:08 2017 (r312049) +++ stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Fri Jan 13 08:59:22 2017 (r312050) @@ -400,13 +400,16 @@ snmptool_get(struct snmp_toolinfo *snmpt if (snmp_parse_resp(&resp, &req) >= 0) { snmp_output_resp(snmptoolctx, &resp, NULL); + snmp_pdu_free(&resp); break; } snmp_output_err_resp(snmptoolctx, &resp); if (GET_PDUTYPE(snmptoolctx) == SNMP_PDU_GETBULK || - !ISSET_RETRY(snmptoolctx)) + !ISSET_RETRY(snmptoolctx)) { + snmp_pdu_free(&resp); break; + } /* * Loop through the object list and set object->error to the @@ -414,15 +417,17 @@ snmptool_get(struct snmp_toolinfo *snmpt */ if (snmp_object_seterror(snmptoolctx, &(resp.bindings[resp.error_index - 1]), - resp.error_status) <= 0) + resp.error_status) <= 0) { + snmp_pdu_free(&resp); break; + } fprintf(stderr, "Retrying...\n"); snmp_pdu_free(&resp); snmp_pdu_create(&req, GET_PDUTYPE(snmptoolctx)); } - snmp_pdu_free(&resp); + snmp_pdu_free(&req); return (0); } @@ -498,27 +503,29 @@ snmptool_walk(struct snmp_toolinfo *snmp } outputs += rc; - snmp_pdu_free(&resp); - if ((u_int)rc < resp.nbindings) + if ((u_int)rc < resp.nbindings) { + snmp_pdu_free(&resp); break; + } snmpwalk_nextpdu_create(op, &(resp.bindings[resp.nbindings - 1].var), &req); if (op == SNMP_PDU_GETBULK) snmpget_fix_getbulk(&req, GET_MAXREP(snmptoolctx), GET_NONREP(snmptoolctx)); + snmp_pdu_free(&resp); } /* Just in case our root was a leaf. */ if (outputs == 0) { snmpwalk_nextpdu_create(SNMP_PDU_GET, &root, &req); if (snmp_dialog(&req, &resp) == SNMP_CODE_OK) { - if (snmp_parse_resp(&resp,&req) < 0) + if (snmp_parse_resp(&resp, &req) < 0) snmp_output_err_resp(snmptoolctx, &resp); else - snmp_output_resp(snmptoolctx, &(resp), NULL); - + snmp_output_resp(snmptoolctx, &resp, + NULL); snmp_pdu_free(&resp); } else warn("Snmp dialog"); @@ -529,9 +536,12 @@ snmptool_walk(struct snmp_toolinfo *snmp break; } + snmp_pdu_free(&req); snmp_pdu_create(&req, op); } + snmp_pdu_free(&req); + if (rc == 0) return (0); else @@ -1089,25 +1099,29 @@ snmptool_set(struct snmp_toolinfo *snmpt if (snmp_pdu_check(&req, &resp) > 0) { if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) snmp_output_resp(snmptoolctx, &resp, NULL); + snmp_pdu_free(&resp); break; } snmp_output_err_resp(snmptoolctx, &resp); - if (!ISSET_RETRY(snmptoolctx)) + if (!ISSET_RETRY(snmptoolctx)) { + snmp_pdu_free(&resp); break; + } if (snmp_object_seterror(snmptoolctx, &(resp.bindings[resp.error_index - 1]), - resp.error_status) <= 0) + resp.error_status) <= 0) { + snmp_pdu_free(&resp); break; + } fprintf(stderr, "Retrying...\n"); snmp_pdu_free(&req); - snmp_pdu_free(&resp); snmp_pdu_create(&req, SNMP_PDU_SET); } - snmp_pdu_free(&resp); + snmp_pdu_free(&req); return (0); } From owner-svn-src-stable-10@freebsd.org Fri Jan 13 09:01:10 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73E26CABF0E; Fri, 13 Jan 2017 09:01:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 411271DB5; Fri, 13 Jan 2017 09:01:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D919dA062079; Fri, 13 Jan 2017 09:01:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D9196V062078; Fri, 13 Jan 2017 09:01:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130901.v0D9196V062078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312052 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:01:10 -0000 Author: ngie Date: Fri Jan 13 09:01:09 2017 New Revision: 312052 URL: https://svnweb.freebsd.org/changeset/base/312052 Log: MFC r311390: snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails CID: 1017276 Modified: stable/10/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.c Fri Jan 13 09:01:06 2017 (r312051) +++ stable/10/contrib/bsnmp/lib/snmpclient.c Fri Jan 13 09:01:09 2017 (r312052) @@ -728,8 +728,11 @@ snmp_table_fetch_async(const struct snmp work->last_change = 0; table_init_pdu(descr, &work->pdu); - if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) + if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) { + free(work); + work = NULL; return (-1); + } return (0); } From owner-svn-src-stable-10@freebsd.org Fri Jan 13 09:04:30 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4350CCAA1FA; Fri, 13 Jan 2017 09:04:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 117841453; Fri, 13 Jan 2017 09:04:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D94Tvd063920; Fri, 13 Jan 2017 09:04:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D94TpI063919; Fri, 13 Jan 2017 09:04:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130904.v0D94TpI063919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312054 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:04:30 -0000 Author: ngie Date: Fri Jan 13 09:04:29 2017 New Revision: 312054 URL: https://svnweb.freebsd.org/changeset/base/312054 Log: MFC r311378: lm_load: fix string copying issues - Ensure `section` doesn't overrun section by using strlcpy instead of strcpy [*]. - Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity, but is an opportunistic change). CID: 1006826 [*] Modified: stable/10/contrib/bsnmp/snmpd/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:04:26 2017 (r312053) +++ stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:04:29 2017 (r312054) @@ -2508,13 +2508,12 @@ lm_load(const char *path, const char *se } m->handle = NULL; m->flags = 0; - strcpy(m->section, section); + strlcpy(m->section, section, sizeof(m->section)); - if ((m->path = malloc(strlen(path) + 1)) == NULL) { + if ((m->path = strdup(path)) == NULL) { syslog(LOG_ERR, "lm_load: %m"); goto err; } - strcpy(m->path, path); /* * Make index From owner-svn-src-stable-10@freebsd.org Fri Jan 13 09:07:27 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 252FCCAA2F2; Fri, 13 Jan 2017 09:07:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB68D179F; Fri, 13 Jan 2017 09:07:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D97QrR064111; Fri, 13 Jan 2017 09:07:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D97Ps7064104; Fri, 13 Jan 2017 09:07:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130907.v0D97Ps7064104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312055 - in stable/10/usr.sbin/bsnmpd/modules: snmp_atm snmp_hast snmp_hostres snmp_mibII snmp_target snmp_usm snmp_vacm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:07:27 -0000 Author: ngie Date: Fri Jan 13 09:07:25 2017 New Revision: 312055 URL: https://svnweb.freebsd.org/changeset/base/312055 Log: MFC r311739: Use SRCTOP instead of spelling out the full path with .CURDIR This helps condense the output for CFLAGS and .PATH Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/ngatm +CONTRIB= ${SRCTOP}/contrib/ngatm .PATH: ${CONTRIB}/snmp_atm MOD= atm Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../../sbin/hastd +.PATH: ${SRCTOP}/sbin/hastd MOD= hast SRCS= ebuf.c @@ -18,7 +18,7 @@ MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= NO_WMISSING_VARIABLE_DECLARATIONS= -CFLAGS+=-I${.CURDIR}/../../../../sbin/hastd +CFLAGS+=-I${SRCTOP}/sbin/hastd CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -28,7 +28,7 @@ # $FreeBSD$ # -LPRSRC= ${.CURDIR}/../../../lpr/common_source +LPRSRC= ${SRCTOP}/usr.sbin/lpr/common_source .PATH: ${LPRSRC} MOD= hostres Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_mibII MOD= mibII Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_target MOD= target Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_usm MOD= usm Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Fri Jan 13 09:04:29 2017 (r312054) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Fri Jan 13 09:07:25 2017 (r312055) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_vacm MOD= vacm From owner-svn-src-stable-10@freebsd.org Fri Jan 13 09:19:05 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF30CAA82C; Fri, 13 Jan 2017 09:19:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1FFA10E2; Fri, 13 Jan 2017 09:19:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D9J4O1068602; Fri, 13 Jan 2017 09:19:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D9J46j068598; Fri, 13 Jan 2017 09:19:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130919.v0D9J46j068598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 09:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312058 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 09:19:06 -0000 Author: ngie Date: Fri Jan 13 09:19:04 2017 New Revision: 312058 URL: https://svnweb.freebsd.org/changeset/base/312058 Log: MFC r310586,r310587,r310588,r311381: r310586: Refactor transport sources a bit to facilitate changes coming down pipeline Add recv callback to transport layer to better facilitate code reuse and readability and for symmetry with send callback. Move recv_dgram and recv_stream to udp_recv and lsock_recv, respectively, and make the beforementioned functions recv callbacks for the udp and lsock transports, respectively. Consolidate the check_priv* functions in their relevant trans*.c source to limit scope/use. Note: this code is roughly based content from the submitter, although this was modified to be more of a direct move from snmpd/main.c to the trans_*.c sources, and to reduce unnecessary static function declarations. r310587: Fix definition for recv_dgram(..); it should be "ssize_t", not "int" I'm not sure why this wasn't flagged as an issue by the compiler, yet r310588: Fix return type for `ret` (recv callback) and sort variables by alignment Again, for reasons I don't yet understand, this is not being flagged by the compiler. Unlike the issue addressed in r310587, this problem existed prior to r310586 r311381: lsock_init_port: address issues with initializing sockaddr_un object - Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*]. - Use SUN_LEN(..) instead of spelling out calculation longhand (inspired by comment by jmallett). Tested with: dgram and stream support with both bsnmpwalk and snmpwalk CID: 1006825 Modified: stable/10/contrib/bsnmp/snmpd/main.c stable/10/contrib/bsnmp/snmpd/snmpd.h stable/10/contrib/bsnmp/snmpd/trans_lsock.c stable/10/contrib/bsnmp/snmpd/trans_udp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/main.c Fri Jan 13 09:19:04 2017 (r312058) @@ -1024,154 +1024,6 @@ snmp_input_consume(struct port_input *pi pi->length -= pi->consumed; } -static void -check_priv_dgram(struct port_input *pi, struct sockcred *cred) -{ - - /* process explicitly sends credentials */ - if (cred) - pi->priv = (cred->sc_euid == 0); - else - pi->priv = 0; -} - -static void -check_priv_stream(struct port_input *pi) -{ - struct xucred ucred; - socklen_t ucredlen; - - /* obtain the accept time credentials */ - ucredlen = sizeof(ucred); - - if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && - ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) - pi->priv = (ucred.cr_uid == 0); - else - pi->priv = 0; -} - -/* - * Input from a stream socket. - */ -static int -recv_stream(struct port_input *pi) -{ - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Return an error - * the caller must close the transport. */ - return (-1); - } - pi->buflen = buf_size(0); - pi->consumed = 0; - pi->length = 0; - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf + pi->length; - iov[0].iov_len = pi->buflen - pi->length; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - pi->length += len; - - if (pi->cred) - check_priv_stream(pi); - - return (0); -} - -/* - * Input from a datagram socket. - * Each receive should return one datagram. - */ -static int -recv_dgram(struct port_input *pi, struct in_addr *laddr) -{ - u_char embuf[1000]; - char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + - CMSG_SPACE(sizeof(struct in_addr))]; - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - struct cmsghdr *cmsg; - struct sockcred *cred = NULL; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Read away input - * and drop it */ - (void)recvfrom(pi->fd, embuf, sizeof(embuf), - 0, NULL, NULL); - /* return error */ - return (-1); - } - pi->buflen = buf_size(0); - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - memset(cbuf, 0, sizeof(cbuf)); - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf; - iov[0].iov_len = pi->buflen; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - if (msg.msg_flags & MSG_TRUNC) { - /* truncated - drop */ - snmpd_stats.silentDrops++; - snmpd_stats.inTooLong++; - return (-1); - } - - pi->length = (size_t)len; - - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level == IPPROTO_IP && - cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_CREDS) - cred = (struct sockcred *)CMSG_DATA(cmsg); - } - - if (pi->cred) - check_priv_dgram(pi, cred); - - return (0); -} - /* * Input from a socket */ @@ -1183,43 +1035,15 @@ snmpd_input(struct port_input *pi, struc struct snmp_pdu pdu; enum snmpd_input_err ierr, ferr; enum snmpd_proxy_err perr; + ssize_t ret, slen; int32_t vi; - int ret; - ssize_t slen; #ifdef USE_TCPWRAPPERS char client[16]; #endif struct msghdr msg; struct iovec iov[1]; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; - - /* get input depending on the transport */ - if (pi->stream) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - - ret = recv_stream(pi); - } else { - struct in_addr *laddr; - - memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); - msg.msg_control = cbuf; - msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - if (laddr->s_addr == 0) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - } + ret = tport->transport->vtab->recv(pi); if (ret == -1) return (-1); Modified: stable/10/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/10/contrib/bsnmp/snmpd/snmpd.h Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/snmpd.h Fri Jan 13 09:19:04 2017 (r312058) @@ -193,6 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); + ssize_t (*recv)(struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/trans_lsock.c Fri Jan 13 09:19:04 2017 (r312058) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t lsock_recv(struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -67,7 +69,8 @@ const struct transport_def lsock_trans = lsock_stop, lsock_close_port, lsock_init_port, - lsock_send + lsock_send, + lsock_recv }; static struct transport *my_trans; @@ -302,10 +305,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_RES_UNAVAIL); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); @@ -357,10 +359,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_GENERR); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); @@ -418,6 +419,73 @@ lsock_send(struct tport *tp, const u_cha return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_stream(struct port_input *pi) +{ + struct xucred ucred; + socklen_t ucredlen; + + /* obtain the accept time credentials */ + ucredlen = sizeof(ucred); + + if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && + ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) + pi->priv = (ucred.cr_uid == 0); + else + pi->priv = 0; +} + +/* + * Receive something + */ +static ssize_t +lsock_recv(struct port_input *pi) +{ + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + + msg.msg_control = NULL; + msg.msg_controllen = 0; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Return an error + * the caller must close the transport. */ + return (-1); + } + pi->buflen = buf_size(0); + pi->consumed = 0; + pi->length = 0; + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf + pi->length; + iov[0].iov_len = pi->buflen - pi->length; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + pi->length += len; + + if (pi->cred) + check_priv_stream(pi); + + return (0); +} + /* * Dependency to create a lsock port */ Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 13 09:11:11 2017 (r312057) +++ stable/10/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 13 09:19:04 2017 (r312058) @@ -32,6 +32,7 @@ */ #include #include +#include #include #include @@ -54,6 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t udp_recv(struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -63,7 +65,8 @@ const struct transport_def udp_trans = { udp_stop, udp_close_port, udp_init_port, - udp_send + udp_send, + udp_recv }; static struct transport *my_trans; @@ -218,6 +221,123 @@ udp_send(struct tport *tp, const u_char return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_dgram(struct port_input *pi, struct sockcred *cred) +{ + + /* process explicitly sends credentials */ + if (cred) + pi->priv = (cred->sc_euid == 0); + else + pi->priv = 0; +} + +/* + * Input from a datagram socket. + * Each receive should return one datagram. + */ +static ssize_t +recv_dgram(struct port_input *pi, struct in_addr *laddr) +{ + u_char embuf[1000]; + char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + + CMSG_SPACE(sizeof(struct in_addr))]; + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + struct cmsghdr *cmsg; + struct sockcred *cred = NULL; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Read away input + * and drop it */ + (void)recvfrom(pi->fd, embuf, sizeof(embuf), + 0, NULL, NULL); + /* return error */ + return (-1); + } + pi->buflen = buf_size(0); + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + memset(cbuf, 0, sizeof(cbuf)); + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf; + iov[0].iov_len = pi->buflen; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + if (msg.msg_flags & MSG_TRUNC) { + /* truncated - drop */ + snmpd_stats.silentDrops++; + snmpd_stats.inTooLong++; + return (-1); + } + + pi->length = (size_t)len; + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == IPPROTO_IP && + cmsg->cmsg_type == IP_RECVDSTADDR) + memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDS) + cred = (struct sockcred *)CMSG_DATA(cmsg); + } + + if (pi->cred) + check_priv_dgram(pi, cred); + + return (0); +} + +/* + * Receive something + */ +static ssize_t +udp_recv(struct port_input *pi) +{ + struct in_addr *laddr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct cmsghdr *cmsgp; + ssize_t ret; + + memset(cbuf, 0, sizeof(cbuf)); + + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsgp = CMSG_FIRSTHDR(&msg); + cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + cmsgp->cmsg_level = IPPROTO_IP; + cmsgp->cmsg_type = IP_SENDSRCADDR; + laddr = (struct in_addr *)CMSG_DATA(cmsgp); + + ret = recv_dgram(pi, laddr); + + if (laddr->s_addr == INADDR_ANY) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } + + return (ret); +} + /* * Port table */ From owner-svn-src-stable-10@freebsd.org Fri Jan 13 10:28:25 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA662CADB69; Fri, 13 Jan 2017 10:28:25 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 916CD149C; Fri, 13 Jan 2017 10:28:25 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DASOYK098704; Fri, 13 Jan 2017 10:28:24 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DASOp8098703; Fri, 13 Jan 2017 10:28:24 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201701131028.v0DASOp8098703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Fri, 13 Jan 2017 10:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312061 - stable/10/contrib/bzip2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 10:28:26 -0000 Author: amdmi3 (ports committer) Date: Fri Jan 13 10:28:24 2017 New Revision: 312061 URL: https://svnweb.freebsd.org/changeset/base/312061 Log: MFC r310718: bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt Differential Revision: D8924 Modified: stable/10/contrib/bzip2/bzip2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bzip2/bzip2.c ============================================================================== --- stable/10/contrib/bzip2/bzip2.c Fri Jan 13 09:32:11 2017 (r312060) +++ stable/10/contrib/bzip2/bzip2.c Fri Jan 13 10:28:24 2017 (r312061) @@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *a case '8': blockSize100k = 8; break; case '9': blockSize100k = 9; break; case 'V': - case 'L': license(); break; + case 'L': license(); + exit ( 0 ); + break; case 'v': verbosity++; break; case 'h': usage ( progName ); exit ( 0 ); @@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *a if (ISFLAG("--keep")) keepInputFiles = True; else if (ISFLAG("--small")) smallMode = True; else if (ISFLAG("--quiet")) noisy = False; else - if (ISFLAG("--version")) license(); else - if (ISFLAG("--license")) license(); else + if (ISFLAG("--version")) { license(); exit ( 0 ); } else + if (ISFLAG("--license")) { license(); exit ( 0 ); } else if (ISFLAG("--exponential")) workFactor = 1; else if (ISFLAG("--repetitive-best")) redundant(aa->name); else if (ISFLAG("--repetitive-fast")) redundant(aa->name); else From owner-svn-src-stable-10@freebsd.org Fri Jan 13 12:44:54 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32D3FCAE940; Fri, 13 Jan 2017 12:44:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01A521690; Fri, 13 Jan 2017 12:44:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DCir3W055693; Fri, 13 Jan 2017 12:44:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCirF8055692; Fri, 13 Jan 2017 12:44:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131244.v0DCirF8055692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312067 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:44:54 -0000 Author: kib Date: Fri Jan 13 12:44:52 2017 New Revision: 312067 URL: https://svnweb.freebsd.org/changeset/base/312067 Log: MFC r311523: Remove dead code. Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:38:25 2017 (r312066) +++ stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:44:52 2017 (r312067) @@ -49,27 +49,6 @@ #include static int -tmpfs_fifo_kqfilter(struct vop_kqfilter_args *ap) -{ - struct vnode *vp; - struct tmpfs_node *node; - - vp = ap->a_vp; - node = VP_TO_TMPFS_NODE(vp); - - switch (ap->a_kn->kn_filter){ - case EVFILT_READ: - node->tn_status |= TMPFS_NODE_ACCESSED; - break; - case EVFILT_WRITE: - node->tn_status |= TMPFS_NODE_MODIFIED; - break; - } - - return fifo_specops.vop_kqfilter(ap); -} - -static int tmpfs_fifo_close(struct vop_close_args *v) { struct tmpfs_node *node; @@ -90,6 +69,5 @@ struct vop_vector tmpfs_fifoop_entries = .vop_access = tmpfs_access, .vop_getattr = tmpfs_getattr, .vop_setattr = tmpfs_setattr, - .vop_kqfilter = tmpfs_fifo_kqfilter, }; From owner-svn-src-stable-10@freebsd.org Fri Jan 13 12:45:55 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A21CAEADE; Fri, 13 Jan 2017 12:45:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 370FF19DC; Fri, 13 Jan 2017 12:45:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DCjseh055798; Fri, 13 Jan 2017 12:45:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCjsEC055797; Fri, 13 Jan 2017 12:45:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131245.v0DCjsEC055797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312068 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:45:55 -0000 Author: kib Date: Fri Jan 13 12:45:54 2017 New Revision: 312068 URL: https://svnweb.freebsd.org/changeset/base/312068 Log: MFC r311524: Use vnode lock assertion expression, assert exclusive ownership. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:44:52 2017 (r312067) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:45:54 2017 (r312068) @@ -1458,7 +1458,7 @@ tmpfs_chflags(struct vnode *vp, u_long f int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chflags"); node = VP_TO_TMPFS_NODE(vp); @@ -1498,9 +1498,9 @@ tmpfs_chflags(struct vnode *vp, u_long f node->tn_flags = flags; node->tn_status |= TMPFS_NODE_CHANGED; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chflags2"); - return 0; + return (0); } /* @@ -1514,7 +1514,7 @@ tmpfs_chmod(struct vnode *vp, mode_t mod int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chmod"); node = VP_TO_TMPFS_NODE(vp); @@ -1554,9 +1554,9 @@ tmpfs_chmod(struct vnode *vp, mode_t mod node->tn_status |= TMPFS_NODE_CHANGED; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chmod2"); - return 0; + return (0); } /* @@ -1575,7 +1575,7 @@ tmpfs_chown(struct vnode *vp, uid_t uid, uid_t ouid; gid_t ogid; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chown"); node = VP_TO_TMPFS_NODE(vp); @@ -1625,9 +1625,9 @@ tmpfs_chown(struct vnode *vp, uid_t uid, node->tn_mode &= ~(S_ISUID | S_ISGID); } - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chown2"); - return 0; + return (0); } /* @@ -1642,7 +1642,7 @@ tmpfs_chsize(struct vnode *vp, u_quad_t int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chsize"); node = VP_TO_TMPFS_NODE(vp); @@ -1680,9 +1680,9 @@ tmpfs_chsize(struct vnode *vp, u_quad_t /* tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents * for us, as will update tn_status; no need to do that here. */ - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chsize2"); - return error; + return (error); } /* @@ -1697,7 +1697,7 @@ tmpfs_chtimes(struct vnode *vp, struct v int error; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chtimes"); node = VP_TO_TMPFS_NODE(vp); @@ -1728,9 +1728,9 @@ tmpfs_chtimes(struct vnode *vp, struct v if (vap->va_birthtime.tv_nsec != VNOVAL && vap->va_birthtime.tv_nsec != VNOVAL) node->tn_birthtime = vap->va_birthtime; - MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_ELOCKED(vp, "chtimes2"); - return 0; + return (0); } /* Sync timestamps */ From owner-svn-src-stable-10@freebsd.org Fri Jan 13 12:47:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E58CAEC15; Fri, 13 Jan 2017 12:47:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84CBB1C84; Fri, 13 Jan 2017 12:47:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DCliKW056020; Fri, 13 Jan 2017 12:47:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DCliDE056016; Fri, 13 Jan 2017 12:47:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701131247.v0DCliDE056016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Jan 2017 12:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312069 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 12:47:45 -0000 Author: kib Date: Fri Jan 13 12:47:44 2017 New Revision: 312069 URL: https://svnweb.freebsd.org/changeset/base/312069 Log: MFC r311525: Lock tmpfs node tn_status updates done under the shared vnode lock. Modified: stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_fifoops.c stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs.h Fri Jan 13 12:47:44 2017 (r312069) @@ -199,7 +199,9 @@ struct tmpfs_node { * allocated for it or it has been reclaimed). */ struct vnode * tn_vnode; - /* interlock to protect tn_vpstate */ + /* Interlock to protect tn_vpstate, and tn_status under shared + * vnode lock. + */ struct mtx tn_interlock; /* Identify if current node has vnode assiocate with @@ -420,6 +422,7 @@ int tmpfs_chtimes(struct vnode *, struct void tmpfs_itimes(struct vnode *, const struct timespec *, const struct timespec *); +void tmpfs_set_status(struct tmpfs_node *node, int status); void tmpfs_update(struct vnode *); int tmpfs_truncate(struct vnode *, off_t); Modified: stable/10/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs_fifoops.c Fri Jan 13 12:47:44 2017 (r312069) @@ -52,11 +52,11 @@ static int tmpfs_fifo_close(struct vop_close_args *v) { struct tmpfs_node *node; - node = VP_TO_TMPFS_NODE(v->a_vp); - node->tn_status |= TMPFS_NODE_ACCESSED; + node = VP_TO_TMPFS_NODE(v->a_vp); + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); tmpfs_update(v->a_vp); - return fifo_specops.vop_close(v); + return (fifo_specops.vop_close(v)); } /* Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Fri Jan 13 12:47:44 2017 (r312069) @@ -1092,9 +1092,9 @@ tmpfs_dir_getdotdent(struct tmpfs_node * else error = uiomove(&dent, dent.d_reclen, uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } /* @@ -1137,9 +1137,9 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod else error = uiomove(&dent, dent.d_reclen, uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } /* @@ -1282,7 +1282,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no node->tn_dir.tn_readdir_lastn = off; node->tn_dir.tn_readdir_lastp = de; - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); return error; } @@ -1733,15 +1733,25 @@ tmpfs_chtimes(struct vnode *vp, struct v return (0); } -/* Sync timestamps */ void -tmpfs_itimes(struct vnode *vp, const struct timespec *acc, +tmpfs_set_status(struct tmpfs_node *node, int status) +{ + + if ((node->tn_status & status) == status) + return; + TMPFS_NODE_LOCK(node); + node->tn_status |= status; + TMPFS_NODE_UNLOCK(node); +} + +/* Sync timestamps */ +static void +tmpfs_itimes_locked(struct tmpfs_node *node, const struct timespec *acc, const struct timespec *mod) { - struct tmpfs_node *node; struct timespec now; - node = VP_TO_TMPFS_NODE(vp); + TMPFS_ASSERT_LOCKED(node); if ((node->tn_status & (TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED)) == 0) @@ -1758,11 +1768,25 @@ tmpfs_itimes(struct vnode *vp, const str mod = &now; node->tn_mtime = *mod; } - if (node->tn_status & TMPFS_NODE_CHANGED) { + if (node->tn_status & TMPFS_NODE_CHANGED) node->tn_ctime = now; - } - node->tn_status &= - ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED); + node->tn_status &= ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | + TMPFS_NODE_CHANGED); +} + +void +tmpfs_itimes(struct vnode *vp, const struct timespec *acc, + const struct timespec *mod) +{ + struct tmpfs_node *node; + + ASSERT_VOP_LOCKED(vp, "tmpfs_itimes"); + node = VP_TO_TMPFS_NODE(vp); + + TMPFS_NODE_LOCK(node); + tmpfs_itimes_locked(node, acc, mod); + TMPFS_NODE_UNLOCK(node); + } void @@ -1794,14 +1818,13 @@ tmpfs_truncate(struct vnode *vp, off_t l return (EFBIG); error = tmpfs_reg_resize(vp, length, FALSE); - if (error == 0) { + if (error == 0) node->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; - } out: tmpfs_update(vp); - return error; + return (error); } static __inline int Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 12:45:54 2017 (r312068) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Fri Jan 13 12:47:44 2017 (r312069) @@ -441,7 +441,7 @@ tmpfs_read(struct vop_read_args *v) if (uio->uio_offset < 0) return (EINVAL); node = VP_TO_TMPFS_NODE(vp); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); return (uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio)); } @@ -1078,8 +1078,8 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_namelen)); /* Check flags to see if we are allowed to remove the directory. */ - if (dnode->tn_flags & APPEND - || node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) { + if ((dnode->tn_flags & APPEND) != 0 || + (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { error = EPERM; goto out; } @@ -1095,7 +1095,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_ASSERT_ELOCKED(node); node->tn_links--; node->tn_dir.tn_parent = NULL; - node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ + node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(node); @@ -1103,8 +1103,8 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_LOCK(dnode); TMPFS_ASSERT_ELOCKED(dnode); dnode->tn_links--; - dnode->tn_status |= TMPFS_NODE_ACCESSED | \ - TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | + TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(dnode); cache_purge(dvp); @@ -1216,9 +1216,9 @@ tmpfs_readlink(struct vop_readlink_args error = uiomove(node->tn_link, MIN(node->tn_size, uio->uio_resid), uio); - node->tn_status |= TMPFS_NODE_ACCESSED; + tmpfs_set_status(node, TMPFS_NODE_ACCESSED); - return error; + return (error); } static int From owner-svn-src-stable-10@freebsd.org Fri Jan 13 21:42:37 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944D1CAEF4A; Fri, 13 Jan 2017 21:42:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46A6113D2; Fri, 13 Jan 2017 21:42:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0DLgaVo083846; Fri, 13 Jan 2017 21:42:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0DLga4A083845; Fri, 13 Jan 2017 21:42:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701132142.v0DLga4A083845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Jan 2017 21:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312085 - in stable: 10/sys/conf 11/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 21:42:37 -0000 Author: jhb Date: Fri Jan 13 21:42:36 2017 New Revision: 312085 URL: https://svnweb.freebsd.org/changeset/base/312085 Log: MFC 304492,310721,310734: Update cxgbe info in NOTES. 304492: Move cxgb and cxgbe down to the non-mii PCI NIC section. 310721: Mention T6 and 100GbE in description of cxgbe. 310734: Note that the Chelsio T6 also supports 25Gbps. To avoid overflowing 80 columns, condense the cxgbe description a bit. Modified: stable/10/sys/conf/NOTES Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/conf/NOTES Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Fri Jan 13 21:30:18 2017 (r312084) +++ stable/10/sys/conf/NOTES Fri Jan 13 21:42:36 2017 (r312085) @@ -1922,8 +1922,9 @@ device xmphy # XaQti XMAC II # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters. -# cxgbe:Chelsio T4 and T5 based 1GbE/10GbE/40GbE PCIe Ethernet adapters. -# cxgbev: Chelsio T4 and T5 based PCIe Virtual Functions. +# cxgbe:Chelsio T4, T5, and T6-based 1/10/25/40/100GbE PCIe Ethernet +# adapters. +# cxgbev: Chelsio T4, T5, and T6-based PCIe Virtual Functions. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics @@ -2072,9 +2073,6 @@ device bce # Broadcom BCM5706/BCM5708 device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device cxgb # Chelsio T3 10 Gigabit Ethernet -device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware -device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) @@ -2105,7 +2103,10 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. -device cxgbev # Chelsio T4 and T5 1GbE/10GbE/40GbE VF +device cxgb # Chelsio T3 10 Gigabit Ethernet +device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware +device cxgbe # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet +device cxgbev # Chelsio T4-T6 Virtual Functions device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet From owner-svn-src-stable-10@freebsd.org Sat Jan 14 00:24:47 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69179CAEF55; Sat, 14 Jan 2017 00:24:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C45A1781; Sat, 14 Jan 2017 00:24:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E0Okr3051728; Sat, 14 Jan 2017 00:24:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0OkL2051726; Sat, 14 Jan 2017 00:24:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140024.v0E0OkL2051726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312089 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:24:47 -0000 Author: ngie Date: Sat Jan 14 00:24:46 2017 New Revision: 312089 URL: https://svnweb.freebsd.org/changeset/base/312089 Log: MFC r310950: MIB-II: use strlcpy when copying interface names to .ifr_name .ifra_name is assumed to be NUL terminated; using strlcpy(3) ensures that it's indeed NUL terminated whereas strncpy does not. Tested and verified as follows with a combination of ifconfig, snmpget, and snmpset: % ifconfig create lo1 127.0.0.2/8 % SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X bsnmptest localhost" % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) CID: 1009652-1009656, 1349850 Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sat Jan 14 00:24:44 2017 (r312088) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sat Jan 14 00:24:46 2017 (r312089) @@ -265,7 +265,7 @@ mib_if_admin(struct mibif *ifp, int up) { struct ifreq ifr; - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIOCGIFFLAGS(%s): %m", ifp->name); return (-1); @@ -515,7 +515,7 @@ mib_fetch_ifmib(struct mibif *ifp) } out: - strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); + strlcpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { @@ -1384,7 +1384,7 @@ siocaifaddr(char *ifname, struct in_addr struct sockaddr_in *sa; memset(&addreq, 0, sizeof(addreq)); - strncpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); + strlcpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); sa = (struct sockaddr_in *)(void *)&addreq.ifra_addr; sa->sin_family = AF_INET; @@ -1414,7 +1414,7 @@ siocdifaddr(const char *ifname, struct i struct sockaddr_in *sa; memset(&delreq, 0, sizeof(delreq)); - strncpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); + strlcpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); sa = (struct sockaddr_in *)(void *)&delreq.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); @@ -1433,7 +1433,7 @@ verify_ifa(const char *name, struct mibi struct sockaddr_in *sa; memset(&req, 0, sizeof(req)); - strncpy(req.ifr_name, name, sizeof(req.ifr_name)); + strlcpy(req.ifr_name, name, sizeof(req.ifr_name)); sa = (struct sockaddr_in *)(void *)&req.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Jan 14 00:24:44 2017 (r312088) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Jan 14 00:24:46 2017 (r312089) @@ -77,7 +77,7 @@ ifchange_func(struct snmp_context *ctx _ switch (op) { case SNMP_DEPOP_COMMIT: - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -95,7 +95,7 @@ ifchange_func(struct snmp_context *ctx _ ifc->rb |= IFRB_FLAGS; } if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); + strlcpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr1) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -116,7 +116,7 @@ ifchange_func(struct snmp_context *ctx _ case SNMP_DEPOP_ROLLBACK: if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); ifr.ifr_flags = ifc->rb_flags; if (ioctl(mib_netsock, SIOCSIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIFFLAGS(%s): %m", ifp->name); From owner-svn-src-stable-10@freebsd.org Sat Jan 14 00:26:53 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C982ACAD0E7; Sat, 14 Jan 2017 00:26:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9EF1AB2; Sat, 14 Jan 2017 00:26:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E0QqY8051963; Sat, 14 Jan 2017 00:26:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0QqYY051962; Sat, 14 Jan 2017 00:26:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140026.v0E0QqYY051962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312091 - stable/10/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:26:53 -0000 Author: ngie Date: Sat Jan 14 00:26:52 2017 New Revision: 312091 URL: https://svnweb.freebsd.org/changeset/base/312091 Log: MFC r311227,r311917: r311227: seekdir_basic: fix various Coverity issues Address.. - .. resource leaks of file descriptors and memory - .. unchecked return values from creat(2), mkdir(2), and telldir(3) - .. potential NULL derefs after calling readdir(3) CID: 975255, 975256, 976989, 978989, 978990 r311917: Fix up r311227 Check for creat returning a value != -1, not a non-zero value Pointyhat to: ngie CID: 1368366 Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c Sat Jan 14 00:26:50 2017 (r312090) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_dir.c Sat Jan 14 00:26:52 2017 (r312091) @@ -39,6 +39,10 @@ #include +#ifdef __FreeBSD__ +#include +#endif + ATF_TC(seekdir_basic); ATF_TC_HEAD(seekdir_basic, tc) { @@ -54,10 +58,26 @@ ATF_TC_BODY(seekdir_basic, tc) struct dirent *entry; long here; +#ifdef __FreeBSD__ +#define CREAT(x, m) do { \ + int _creat_fd; \ + ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ + "creat(%s, %x) failed: %s", (x), (m), \ + strerror(errno)); \ + (void)close(_creat_fd); \ + } while(0); + + ATF_REQUIRE_MSG(mkdir("t", 0755) == 0, + "mkdir failed: %s", strerror(errno)); + CREAT("t/a", 0600); + CREAT("t/b", 0600); + CREAT("t/c", 0600); +#else mkdir("t", 0755); creat("t/a", 0600); creat("t/b", 0600); creat("t/c", 0600); +#endif dp = opendir("t"); if ( dp == NULL) @@ -70,9 +90,17 @@ ATF_TC_BODY(seekdir_basic, tc) /* get first entry */ entry = readdir(dp); here = telldir(dp); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(here != -1, + "telldir failed: %s", strerror(errno)); +#endif /* get second entry */ entry = readdir(dp); +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(entry != NULL, + "readdir failed: %s", strerror(errno)); +#endif wasname = strdup(entry->d_name); if (wasname == NULL) atf_tc_fail("cannot allocate memory"); @@ -109,6 +137,9 @@ ATF_TC_BODY(seekdir_basic, tc) atf_tc_fail("3rd seekdir found wrong name"); closedir(dp); +#ifdef __FreeBSD__ + free(wasname); +#endif } ATF_TC(telldir_leak); From owner-svn-src-stable-10@freebsd.org Sat Jan 14 00:28:22 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54A46CAD1CE; Sat, 14 Jan 2017 00:28:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 263181DA4; Sat, 14 Jan 2017 00:28:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E0SLSb052118; Sat, 14 Jan 2017 00:28:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0SLGG052117; Sat, 14 Jan 2017 00:28:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140028.v0E0SLGG052117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312092 - stable/10/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:28:22 -0000 Author: ngie Date: Sat Jan 14 00:28:21 2017 New Revision: 312092 URL: https://svnweb.freebsd.org/changeset/base/312092 Log: MFC r311926: Consolidate __NetBSD__ #ifdef Modified: stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c Sat Jan 14 00:26:52 2017 (r312091) +++ stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c Sat Jan 14 00:28:21 2017 (r312092) @@ -48,9 +48,7 @@ #ifdef __NetBSD__ static void s_print(struct re_guts *, FILE *); static char *regchar(int); -#endif -#ifdef __NetBSD__ /* * regprint - print a regexp for debugging */ From owner-svn-src-stable-10@freebsd.org Sat Jan 14 00:29:57 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FA3BCAD2C5; Sat, 14 Jan 2017 00:29:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2992109F; Sat, 14 Jan 2017 00:29:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E0Tuu3052347; Sat, 14 Jan 2017 00:29:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0TtMX052345; Sat, 14 Jan 2017 00:29:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140029.v0E0TtMX052345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312095 - stable/10/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:29:57 -0000 Author: ngie Date: Sat Jan 14 00:29:55 2017 New Revision: 312095 URL: https://svnweb.freebsd.org/changeset/base/312095 Log: MFC r311924: Fix whitespace in comment Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Sat Jan 14 00:29:55 2017 (r312094) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Sat Jan 14 00:29:55 2017 (r312095) @@ -64,7 +64,7 @@ ATF_TC_BODY(setdomainname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Jan 14 00:29:55 2017 (r312094) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Jan 14 00:29:55 2017 (r312095) @@ -66,7 +66,7 @@ ATF_TC_BODY(sethostname_basic, tc) (void)memset(name, 0, sizeof(name)); #ifdef __FreeBSD__ - /* + /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 */ From owner-svn-src-stable-10@freebsd.org Sat Jan 14 00:33:04 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E15ACCAD515; Sat, 14 Jan 2017 00:33:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2EAC1678; Sat, 14 Jan 2017 00:33:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E0X340056321; Sat, 14 Jan 2017 00:33:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0X38M056320; Sat, 14 Jan 2017 00:33:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140033.v0E0X38M056320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312096 - stable/10/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:33:05 -0000 Author: ngie Date: Sat Jan 14 00:33:03 2017 New Revision: 312096 URL: https://svnweb.freebsd.org/changeset/base/312096 Log: MFC r311236,r311919: r311236: unlink_fifo: don't leak the file descriptors opened with mkfifo and open MFC fater: 3 days CID: 978316, 978317 r311919: Partially revert r311236 There's no sense in trying to close a file descriptor from the negative cases with unlink_test; it's best to ignore these cases. The mkfifo case does make sense to keep though. Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Sat Jan 14 00:29:55 2017 (r312095) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Sat Jan 14 00:33:03 2017 (r312096) @@ -111,8 +111,15 @@ ATF_TC_HEAD(unlink_fifo, tc) ATF_TC_BODY(unlink_fifo, tc) { +#ifdef __FreeBSD__ + int fd; + ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0, + "mkfifo failed: %s", strerror(errno)); + (void)close(fd); +#else ATF_REQUIRE(mkfifo(path, 0666) == 0); +#endif ATF_REQUIRE(unlink(path) == 0); errno = 0; From owner-svn-src-stable-10@freebsd.org Sat Jan 14 00:36:49 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FA7DCAD769; Sat, 14 Jan 2017 00:36:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31E581A45; Sat, 14 Jan 2017 00:36:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E0amnv056629; Sat, 14 Jan 2017 00:36:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0amFg056628; Sat, 14 Jan 2017 00:36:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140036.v0E0amFg056628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312098 - stable/10/contrib/bsnmp/gensnmpdef X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:36:49 -0000 Author: ngie Date: Sat Jan 14 00:36:48 2017 New Revision: 312098 URL: https://svnweb.freebsd.org/changeset/base/312098 Log: MFC r311750,r311754,r311757: r311750: Check result from smiGetFirstNode and smiGetNodeByOID This avoids a segfault with malformed or unanticipated files, like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS). Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt r311754: Use calloc instead of malloc + memset(.., 0, ..) r311757: Similar to r311750, check for the result from smiGetModule to avoid a segfault when dereferencing a NULL pointer later on. Choose to just check for the NULL pointer in the next for-loop for now to fix the issue with a minimal amount of code churn sys/queue.h use here would make more sense than using a static table Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Jan 14 00:33:07 2017 (r312097) +++ stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Jan 14 00:36:48 2017 (r312098) @@ -126,9 +126,11 @@ open_node(const SmiNode *n, u_int level, while (level < n->oidlen - 1) { if (level >= cut) { + n1 = smiGetNodeByOID(level + 1, n->oid); + if (n1 == NULL) + continue; pindent(level); printf("(%u", n->oid[level]); - n1 = smiGetNodeByOID(level + 1, n->oid); printf(" "); print_name(n1); printf("\n"); @@ -397,12 +399,11 @@ static void save_typdef(char *name) { struct tdef *t; - t = malloc(sizeof(struct tdef)); + t = calloc(1, sizeof(struct tdef)); if (t == NULL) err(1, NULL); - memset(t, 0 , sizeof(struct tdef)); t->name = name; SLIST_INSERT_HEAD(&tdefs, t, link); } @@ -559,7 +560,11 @@ main(int argc, char *argv[]) level = 0; last = NULL; for (opt = 0; opt < argc; opt++) { + if (mods[opt] == NULL) /* smiGetModule failed above */ + continue; n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); + if (n == NULL) + continue; for (;;) { if (do_typedef == 0) { level = open_node(n, level, &last); From owner-svn-src-stable-10@freebsd.org Sat Jan 14 00:39:56 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FFF3CAD9F7; Sat, 14 Jan 2017 00:39:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FF8810B0; Sat, 14 Jan 2017 00:39:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E0dt1N056856; Sat, 14 Jan 2017 00:39:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E0dt3I056855; Sat, 14 Jan 2017 00:39:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701140039.v0E0dt3I056855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 14 Jan 2017 00:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312100 - stable/10/tools/tools/gensnmpdef X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 00:39:56 -0000 Author: ngie Date: Sat Jan 14 00:39:55 2017 New Revision: 312100 URL: https://svnweb.freebsd.org/changeset/base/312100 Log: MFC r311748: Bump WARNS up from 0 to 6 Modified: stable/10/tools/tools/gensnmpdef/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/gensnmpdef/Makefile ============================================================================== --- stable/10/tools/tools/gensnmpdef/Makefile Sat Jan 14 00:36:50 2017 (r312099) +++ stable/10/tools/tools/gensnmpdef/Makefile Sat Jan 14 00:39:55 2017 (r312100) @@ -19,4 +19,6 @@ LDFLAGS+= -L${LOCALBASE}/lib LDADD+= -lsmi +WARNS?= 6 + .include From owner-svn-src-stable-10@freebsd.org Sat Jan 14 04:34:31 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9758CAF976; Sat, 14 Jan 2017 04:34:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 757A9119E; Sat, 14 Jan 2017 04:34:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0E4YUbd055989; Sat, 14 Jan 2017 04:34:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0E4YUIT055980; Sat, 14 Jan 2017 04:34:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701140434.v0E4YUIT055980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 04:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312117 - stable/10/sys/dev/cxgbe/tom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 04:34:31 -0000 Author: np Date: Sat Jan 14 04:34:30 2017 New Revision: 312117 URL: https://svnweb.freebsd.org/changeset/base/312117 Log: MFC r311569, r311657, and r311949. r311569: Fix comment in t4_tom. No functional change. r311657: cxgbe/t4_tom: Fix tid accounting. An offloaded IPv6 connection uses 2 tids, not 1, in the hardware. r311949: cxgbe/tom: Add VIMAGE support to the TOE driver. Active Open: - Save the socket's vnet at the time of the active open (t4_connect) and switch to it when processing the reply (do_act_open_rpl or do_act_establish). Passive Open: - Save the listening socket's vnet in the driver's listen_ctx and switch to it when processing incoming SYNs for the socket. - Reject SYNs that arrive on an ifnet that's not in the same vnet as the listening socket. CLIP (Compressed Local IPv6) table: - Add only those IPv6 addresses to the CLIP that are in a vnet associated with one of the card's ifnets. Misc: - Set vnet from the toepcb when processing TCP state transitions. - The kernel sets the vnet when calling the driver's output routine so t4_push_frames runs in proper vnet context already. One exception is when incoming credits trigger tx within the driver's ithread. Set the vnet explicitly in do_fw4_ack for that case. Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_ddp.c stable/10/sys/dev/cxgbe/tom/t4_listen.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_connect.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_connect.c Sat Jan 14 04:34:30 2017 (r312117) @@ -107,7 +107,7 @@ free_atid(struct adapter *sc, int atid) } /* - * Active open failed. + * Active open succeeded. */ static int do_act_establish(struct sge_iq *iq, const struct rss_header *rss, @@ -126,9 +126,10 @@ do_act_establish(struct sge_iq *iq, cons CTR3(KTR_CXGBE, "%s: atid %u, tid %u", __func__, atid, tid); free_atid(sc, atid); + CURVNET_SET(toep->vnet); INP_WLOCK(inp); toep->tid = tid; - insert_tid(sc, tid, toep); + insert_tid(sc, tid, toep, inp->inp_vflag & INP_IPV6 ? 2 : 1); if (inp->inp_flags & INP_DROPPED) { /* socket closed by the kernel before hw told us it connected */ @@ -141,6 +142,7 @@ do_act_establish(struct sge_iq *iq, cons make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); done: INP_WUNLOCK(inp); + CURVNET_RESTORE(); return (0); } @@ -178,6 +180,7 @@ act_open_failure_cleanup(struct adapter free_atid(sc, atid); toep->tid = -1; + CURVNET_SET(toep->vnet); if (status != EAGAIN) INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); @@ -185,8 +188,12 @@ act_open_failure_cleanup(struct adapter final_cpl_received(toep); /* unlocks inp */ if (status != EAGAIN) INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); } +/* + * Active open failed. + */ static int do_act_open_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) @@ -357,6 +364,7 @@ t4_connect(struct toedev *tod, struct so if (wr == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); + toep->vnet = so->so_vnet; if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) set_tcpddp_ulp_mode(toep); else Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jan 14 04:34:30 2017 (r312117) @@ -302,7 +302,6 @@ make_established(struct toepcb *toep, ui uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; - CURVNET_SET(so->so_vnet); INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || tp->t_state == TCPS_SYN_RECEIVED, @@ -353,7 +352,6 @@ make_established(struct toepcb *toep, ui send_flowc_wr(toep, &ftxp); soisconnected(so); - CURVNET_RESTORE(); } static int @@ -1107,6 +1105,7 @@ do_peer_close(struct sge_iq *iq, const s KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1150,6 +1149,7 @@ do_peer_close(struct sge_iq *iq, const s tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); @@ -1162,6 +1162,7 @@ do_peer_close(struct sge_iq *iq, const s done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1188,6 +1189,7 @@ do_close_con_rpl(struct sge_iq *iq, cons KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1207,6 +1209,7 @@ do_close_con_rpl(struct sge_iq *iq, cons release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); INP_WLOCK(inp); final_cpl_received(toep); /* no more CPLs expected */ @@ -1231,6 +1234,7 @@ release: done: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1304,6 +1308,7 @@ do_abort_req(struct sge_iq *iq, const st } inp = toep->inp; + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for tcp_close */ INP_WLOCK(inp); @@ -1339,6 +1344,7 @@ do_abort_req(struct sge_iq *iq, const st final_cpl_received(toep); done: INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); send_abort_rpl(sc, ofld_txq, tid, CPL_ABORT_NO_RST); return (0); } @@ -1456,18 +1462,21 @@ do_rx_data(struct sge_iq *iq, const stru SOCKBUF_UNLOCK(sb); INP_WUNLOCK(inp); + CURVNET_SET(toep->vnet); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } /* receive buffer autosize */ - CURVNET_SET(so->so_vnet); + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -1674,10 +1683,12 @@ do_fw4_ack(struct sge_iq *iq, const stru if (toep->flags & TPF_TX_SUSPENDED && toep->tx_credits >= toep->tx_total / 4) { toep->flags &= ~TPF_TX_SUSPENDED; + CURVNET_SET(toep->vnet); if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); else t4_push_frames(sc, toep, plen); + CURVNET_RESTORE(); } else if (plen > 0) { struct sockbuf *sb = &so->so_snd; int sbu; Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_ddp.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_ddp.c Sat Jan 14 04:34:30 2017 (r312117) @@ -392,6 +392,9 @@ handle_ddp_data(struct toepcb *toep, __b discourage_ddp(toep); /* receive buffer autosize */ + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); + SOCKBUF_LOCK(sb); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -405,6 +408,7 @@ handle_ddp_data(struct toepcb *toep, __b else toep->rx_credits += newsize - hiwat; } + CURVNET_RESTORE(); KASSERT(toep->sb_cc >= sb->sb_cc, ("%s: sb %p has more data (%d) than last time (%d).", Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_listen.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_listen.c Sat Jan 14 04:34:30 2017 (r312117) @@ -220,6 +220,7 @@ alloc_lctx(struct adapter *sc, struct in TAILQ_INIT(&lctx->synq); lctx->inp = inp; + lctx->vnet = inp->inp_socket->so_vnet; in_pcbref(inp); return (lctx); @@ -825,14 +826,16 @@ done_with_synqe(struct adapter *sc, stru struct inpcb *inp = lctx->inp; struct vi_info *vi = synqe->syn->m_pkthdr.rcvif->if_softc; struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + int ntids; INP_WLOCK_ASSERT(inp); + ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(sc, lctx); if (inp) INP_WUNLOCK(inp); - remove_tid(sc, synqe->tid); + remove_tid(sc, synqe->tid, ntids); release_tid(sc, synqe->tid, &sc->sge.ctrlq[vi->pi->port_id]); t4_l2t_release(e); release_synqe(synqe); /* removed from synq list */ @@ -1235,7 +1238,7 @@ do_pass_accept_req(struct sge_iq *iq, co struct l2t_entry *e = NULL; int rscale, mtu_idx, rx_credits, rxqid, ulp_mode; struct synq_entry *synqe = NULL; - int reject_reason, v; + int reject_reason, v, ntids; uint16_t vid; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); @@ -1253,6 +1256,8 @@ do_pass_accept_req(struct sge_iq *iq, co pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; + CURVNET_SET(lctx->vnet); + /* * Use the MAC index to lookup the associated VI. If this SYN * didn't match a perfect MAC filter, punt. @@ -1309,6 +1314,8 @@ found: */ if (!ifnet_has_ip6(ifp, &inc.inc6_laddr)) REJECT_PASS_ACCEPT(); + + ntids = 2; } else { /* Don't offload if the ifcap isn't enabled */ @@ -1321,8 +1328,17 @@ found: */ if (!ifnet_has_ip(ifp, inc.inc_laddr)) REJECT_PASS_ACCEPT(); + + ntids = 1; } + /* + * Don't offload if the ifnet that the SYN came in on is not in the same + * vnet as the listening socket. + */ + if (lctx->vnet != ifp->if_vnet) + REJECT_PASS_ACCEPT(); + e = get_l2te_for_nexthop(pi, ifp, &inc); if (e == NULL) REJECT_PASS_ACCEPT(); @@ -1362,7 +1378,6 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; - CURVNET_SET(so->so_vnet); mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; @@ -1398,7 +1413,7 @@ found: synqe->rcv_bufsize = rx_credits; atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr); - insert_tid(sc, tid, synqe); + insert_tid(sc, tid, synqe, ntids); TAILQ_INSERT_TAIL(&lctx->synq, synqe, link); hold_synqe(synqe); /* hold for the duration it's in the synq */ hold_lctx(lctx); /* A synqe on the list has a ref on its lctx */ @@ -1409,7 +1424,6 @@ found: */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ - CURVNET_RESTORE(); /* * If we replied during syncache_add (synqe->wr has been consumed), @@ -1427,7 +1441,7 @@ found: if (m) m->m_pkthdr.rcvif = hw_ifp; - remove_tid(sc, synqe->tid); + remove_tid(sc, synqe->tid, ntids); free(wr, M_CXGBE); /* Yank the synqe out of the lctx synq. */ @@ -1464,10 +1478,12 @@ found: return (__LINE__); } INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (0); reject: + CURVNET_RESTORE(); CTR4(KTR_CXGBE, "%s: stid %u, tid %u, REJECT (%d)", __func__, stid, tid, reject_reason); @@ -1539,6 +1555,7 @@ do_pass_establish(struct sge_iq *iq, con KASSERT(synqe->flags & TPF_SYNQE, ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); + CURVNET_SET(lctx->vnet); INP_INFO_RLOCK(&V_tcbinfo); /* for syncache_expand */ INP_WLOCK(inp); @@ -1556,6 +1573,7 @@ do_pass_establish(struct sge_iq *iq, con INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } @@ -1581,6 +1599,7 @@ reset: send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); return (0); } toep->tid = tid; @@ -1617,6 +1636,8 @@ reset: /* New connection inpcb is already locked by syncache_expand(). */ new_inp = sotoinpcb(so); INP_WLOCK_ASSERT(new_inp); + MPASS(so->so_vnet == lctx->vnet); + toep->vnet = lctx->vnet; /* * This is for the unlikely case where the syncache entry that we added @@ -1640,6 +1661,7 @@ reset: if (inp != NULL) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); release_synqe(synqe); return (0); Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Sat Jan 14 04:34:30 2017 (r312117) @@ -321,7 +321,7 @@ release_offload_resources(struct toepcb t4_l2t_release(toep->l2te); if (tid >= 0) { - remove_tid(sc, tid); + remove_tid(sc, tid, toep->ce ? 2 : 1); release_tid(sc, tid, toep->ctrlq); } @@ -432,12 +432,12 @@ final_cpl_received(struct toepcb *toep) } void -insert_tid(struct adapter *sc, int tid, void *ctx) +insert_tid(struct adapter *sc, int tid, void *ctx, int ntids) { struct tid_info *t = &sc->tids; t->tid_tab[tid] = ctx; - atomic_add_int(&t->tids_in_use, 1); + atomic_add_int(&t->tids_in_use, ntids); } void * @@ -457,12 +457,12 @@ update_tid(struct adapter *sc, int tid, } void -remove_tid(struct adapter *sc, int tid) +remove_tid(struct adapter *sc, int tid, int ntids) { struct tid_info *t = &sc->tids; t->tid_tab[tid] = NULL; - atomic_subtract_int(&t->tids_in_use, 1); + atomic_subtract_int(&t->tids_in_use, ntids); } void @@ -811,74 +811,96 @@ update_clip_table(struct adapter *sc, st struct in6_addr *lip, tlip; struct clip_head stale; struct clip_entry *ce, *ce_temp; - int rc, gen = atomic_load_acq_int(&in6_ifaddr_gen); + struct vi_info *vi; + int rc, gen, i, j; + uintptr_t last_vnet; ASSERT_SYNCHRONIZED_OP(sc); IN6_IFADDR_RLOCK(); mtx_lock(&td->clip_table_lock); + gen = atomic_load_acq_int(&in6_ifaddr_gen); if (gen == td->clip_gen) goto done; TAILQ_INIT(&stale); TAILQ_CONCAT(&stale, &td->clip_table, link); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - lip = &ia->ia_addr.sin6_addr; + /* + * last_vnet optimizes the common cases where all if_vnet = NULL (no + * VIMAGE) or all if_vnet = vnet0. + */ + last_vnet = (uintptr_t)(-1); + for_each_port(sc, i) + for_each_vi(sc->port[i], j, vi) { + if (last_vnet == (uintptr_t)vi->ifp->if_vnet) + continue; - KASSERT(!IN6_IS_ADDR_MULTICAST(lip), - ("%s: mcast address in in6_ifaddr list", __func__)); + /* XXX: races with if_vmove */ + CURVNET_SET(vi->ifp->if_vnet); + TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + lip = &ia->ia_addr.sin6_addr; + + KASSERT(!IN6_IS_ADDR_MULTICAST(lip), + ("%s: mcast address in in6_ifaddr list", __func__)); + + if (IN6_IS_ADDR_LOOPBACK(lip)) + continue; + if (IN6_IS_SCOPE_EMBED(lip)) { + /* Remove the embedded scope */ + tlip = *lip; + lip = &tlip; + in6_clearscope(lip); + } + /* + * XXX: how to weed out the link local address for the + * loopback interface? It's fe80::1 usually (always?). + */ + + /* + * If it's in the main list then we already know it's + * not stale. + */ + TAILQ_FOREACH(ce, &td->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + goto next; + } - if (IN6_IS_ADDR_LOOPBACK(lip)) - continue; - if (IN6_IS_SCOPE_EMBED(lip)) { - /* Remove the embedded scope */ - tlip = *lip; - lip = &tlip; - in6_clearscope(lip); - } - /* - * XXX: how to weed out the link local address for the loopback - * interface? It's fe80::1 usually (always?). - */ - - /* - * If it's in the main list then we already know it's not stale. - */ - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - goto next; - } + /* + * If it's in the stale list we should move it to the + * main list. + */ + TAILQ_FOREACH(ce, &stale, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { + TAILQ_REMOVE(&stale, ce, link); + TAILQ_INSERT_TAIL(&td->clip_table, ce, + link); + goto next; + } + } - /* - * If it's in the stale list we should move it to the main list. - */ - TAILQ_FOREACH(ce, &stale, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { - TAILQ_REMOVE(&stale, ce, link); + /* A new IP6 address; add it to the CLIP table */ + ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); + memcpy(&ce->lip, lip, sizeof(ce->lip)); + ce->refcount = 0; + rc = add_lip(sc, lip); + if (rc == 0) TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - goto next; - } - } + else { + char ip[INET6_ADDRSTRLEN]; - /* A new IP6 address; add it to the CLIP table */ - ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); - memcpy(&ce->lip, lip, sizeof(ce->lip)); - ce->refcount = 0; - rc = add_lip(sc, lip); - if (rc == 0) - TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip)); - log(LOG_ERR, "%s: could not add %s (%d)\n", - __func__, ip, rc); - free(ce, M_CXGBE); - } + inet_ntop(AF_INET6, &ce->lip, &ip[0], + sizeof(ip)); + log(LOG_ERR, "%s: could not add %s (%d)\n", + __func__, ip, rc); + free(ce, M_CXGBE); + } next: - continue; + continue; + } + CURVNET_RESTORE(); + last_vnet = (uintptr_t)vi->ifp->if_vnet; } /* Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.h Sat Jan 14 04:24:49 2017 (r312116) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.h Sat Jan 14 04:34:30 2017 (r312117) @@ -123,6 +123,7 @@ struct toepcb { u_int flags; /* miscellaneous flags */ struct tom_data *td; struct inpcb *inp; /* backpointer to host stack's PCB */ + struct vnet *vnet; struct vi_info *vi; /* virtual interface */ struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; @@ -199,6 +200,7 @@ struct listen_ctx { struct stid_region stid_region; int flags; struct inpcb *inp; /* listening socket's inp */ + struct vnet *vnet; struct sge_wrq *ctrlq; struct sge_ofld_rxq *ofld_rxq; struct clip_entry *ce; @@ -278,10 +280,10 @@ void free_toepcb(struct toepcb *); void offload_socket(struct socket *, struct toepcb *); void undo_offload_socket(struct socket *); void final_cpl_received(struct toepcb *); -void insert_tid(struct adapter *, int, void *); +void insert_tid(struct adapter *, int, void *, int); void *lookup_tid(struct adapter *, int); void update_tid(struct adapter *, int, void *); -void remove_tid(struct adapter *, int); +void remove_tid(struct adapter *, int, int); void release_tid(struct adapter *, int, struct sge_wrq *); int find_best_mtu_idx(struct adapter *, struct in_conninfo *, int); u_long select_rcv_wnd(struct socket *); From owner-svn-src-stable-10@freebsd.org Sat Jan 14 10:39:01 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B62BCA78DB; Sat, 14 Jan 2017 10:39:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37BC018C6; Sat, 14 Jan 2017 10:39:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAd0xA005688; Sat, 14 Jan 2017 10:39:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAd0EH005687; Sat, 14 Jan 2017 10:39:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141039.v0EAd0EH005687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312165 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:39:01 -0000 Author: arybchik Date: Sat Jan 14 10:39:00 2017 New Revision: 312165 URL: https://svnweb.freebsd.org/changeset/base/312165 Log: MFC r311877 sfxge(4): avoid unnecessary mbuf data prefetch Unnecessary prefetch just loads HW prefetcher and displaces other cache entries (which could be really useful). If we parse mbuf for TSO early and use firmware-assisted TSO, we do not expect mbuf data access when we compose firmware-assisted TSO (v1 or v2) option descriptors. If packet header needs to be linearized or finally FATSO cannot be used because of, for example, too big header, we do not care about a bit more performance degradation because of prefetch absence (it is better to optimize more common case). Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:38:39 2017 (r312164) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:39:00 2017 (r312165) @@ -356,8 +356,22 @@ static int sfxge_tx_queue_mbuf(struct sf KASSERT(!txq->blocked, ("txq->blocked")); +#if SFXGE_TX_PARSE_EARLY + /* + * If software TSO is used, we still need to copy packet header, + * even if we have already parsed it early before enqueue. + */ + if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) && + (txq->tso_fw_assisted == 0)) + prefetch_read_many(mbuf->m_data); +#else + /* + * Prefetch packet header since we need to parse it and extract + * IP ID, TCP sequence number and flags. + */ if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) prefetch_read_many(mbuf->m_data); +#endif if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) { rc = EINTR; From owner-svn-src-stable-10@freebsd.org Sat Jan 14 10:39:43 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F5DACA7975; Sat, 14 Jan 2017 10:39:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C9231A40; Sat, 14 Jan 2017 10:39:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAdgY3005769; Sat, 14 Jan 2017 10:39:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAdgZq005767; Sat, 14 Jan 2017 10:39:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141039.v0EAdgZq005767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312166 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:39:43 -0000 Author: arybchik Date: Sat Jan 14 10:39:42 2017 New Revision: 312166 URL: https://svnweb.freebsd.org/changeset/base/312166 Log: MFC r311961 sfxge(4): do not ignore requested MAC stats update period Firmware version which takes PERIOD_MS parameter into account is required. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/efx_mcdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Sat Jan 14 10:39:00 2017 (r312165) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Sat Jan 14 10:39:42 2017 (r312166) @@ -1725,7 +1725,8 @@ static __checkReturn efx_rc_t efx_mcdi_mac_stats( __in efx_nic_t *enp, __in_opt efsys_mem_t *esmp, - __in efx_stats_action_t action) + __in efx_stats_action_t action, + __in uint16_t period_ms) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_MAC_STATS_IN_LEN, @@ -1750,7 +1751,7 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable, MAC_STATS_IN_PERIODIC_ENABLE, enable | events, MAC_STATS_IN_PERIODIC_NOEVENT, !events, - MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0); + MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0); if (esmp != NULL) { int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); @@ -1800,7 +1801,7 @@ efx_mcdi_mac_stats_clear( { efx_rc_t rc; - if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR, 0)) != 0) goto fail1; return (0); @@ -1823,7 +1824,7 @@ efx_mcdi_mac_stats_upload( * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. */ - if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD, 0)) != 0) goto fail1; return (0); @@ -1838,7 +1839,7 @@ fail1: efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events) { efx_rc_t rc; @@ -1847,14 +1848,17 @@ efx_mcdi_mac_stats_periodic( * The MC DMAs aggregate statistics for our convenience, so we can * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. - * Huntington uses a fixed 1sec period, so use that on Siena too. + * Huntington uses a fixed 1sec period. + * Medford uses a fixed 1sec period before v6.2.1.1033 firmware. */ - if (period == 0) - rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE); + if (period_ms == 0) + rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE, 0); else if (events) - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS, + period_ms); else - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS); + rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS, + period_ms); if (rc != 0) goto fail1; Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.h Sat Jan 14 10:39:00 2017 (r312165) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.h Sat Jan 14 10:39:42 2017 (r312166) @@ -218,7 +218,7 @@ extern __checkReturn efx_rc_t efx_mcdi_mac_stats_periodic( __in efx_nic_t *enp, __in efsys_mem_t *esmp, - __in uint16_t period, + __in uint16_t period_ms, __in boolean_t events); From owner-svn-src-stable-10@freebsd.org Sat Jan 14 10:50:46 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92864CA7DDA; Sat, 14 Jan 2017 10:50:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62092114C; Sat, 14 Jan 2017 10:50:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAojv2012191; Sat, 14 Jan 2017 10:50:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAoje9012188; Sat, 14 Jan 2017 10:50:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141050.v0EAoje9012188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312167 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:50:46 -0000 Author: arybchik Date: Sat Jan 14 10:50:45 2017 New Revision: 312167 URL: https://svnweb.freebsd.org/changeset/base/312167 Log: MFC r311962 sfxge(4): stats refresh in SW should depend on HW update period The period should be taken into account by the function which refreshes driver stats. Reviewed by: philip Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:39:42 2017 (r312166) +++ stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:50:45 2017 (r312167) @@ -94,14 +94,6 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, &sfxge_tx_ring_entries, 0, "Maximum number of descriptors in a transmit ring"); -#define SFXGE_PARAM_STATS_UPDATE_PERIOD SFXGE_PARAM(stats_update_period) -static int sfxge_stats_update_period = SFXGE_CALLOUT_TICKS; -TUNABLE_INT(SFXGE_PARAM_STATS_UPDATE_PERIOD, - &sfxge_stats_update_period); -SYSCTL_INT(_hw_sfxge, OID_AUTO, stats_update_period, CTLFLAG_RDTUN, - &sfxge_stats_update_period, 0, - "netstat interface statistics update period in ticks"); - #define SFXGE_PARAM_RESTART_ATTEMPTS SFXGE_PARAM(restart_attempts) static int sfxge_restart_attempts = 3; TUNABLE_INT(SFXGE_PARAM_RESTART_ATTEMPTS, &sfxge_restart_attempts); @@ -558,7 +550,7 @@ sfxge_tick(void *arg) sfxge_port_update_stats(sc); sfxge_tx_update_stats(sc); - callout_reset(&sc->tick_callout, sfxge_stats_update_period, + callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, sfxge_tick, sc); } @@ -623,7 +615,7 @@ sfxge_ifnet_init(struct ifnet *ifp, stru if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; - callout_reset(&sc->tick_callout, sfxge_stats_update_period, + callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, sfxge_tick, sc); return (0); Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:39:42 2017 (r312166) +++ stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:50:45 2017 (r312167) @@ -158,7 +158,7 @@ enum sfxge_evq_state { #define SFXGE_EV_BATCH 16384 -#define SFXGE_CALLOUT_TICKS 100 +#define SFXGE_STATS_UPDATE_PERIOD_MS 1000 struct sfxge_evq { /* Structure members below are sorted by usage order */ Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:39:42 2017 (r312166) +++ stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:50:45 2017 (r312167) @@ -51,6 +51,7 @@ sfxge_mac_stat_update(struct sfxge_softc struct sfxge_port *port = &sc->port; efsys_mem_t *esmp = &(port->mac_stats.dma_buf); clock_t now; + unsigned int min_ticks; unsigned int count; int rc; @@ -61,8 +62,10 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } + min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + now = ticks; - if ((unsigned int)(now - port->mac_stats.update_time) < (unsigned int)hz) { + if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { rc = 0; goto out; } @@ -483,9 +486,10 @@ sfxge_port_start(struct sfxge_softc *sc) sfxge_mac_filter_set_locked(sc); - /* Update MAC stats by DMA every second */ + /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 1000, B_FALSE)) != 0) + SFXGE_STATS_UPDATE_PERIOD_MS, + B_FALSE)) != 0) goto fail6; if ((rc = efx_mac_drain(enp, B_FALSE)) != 0) From owner-svn-src-stable-10@freebsd.org Sat Jan 14 10:58:10 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3502FCAE04A; Sat, 14 Jan 2017 10:58:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E994E16AE; Sat, 14 Jan 2017 10:58:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAw9Ps014011; Sat, 14 Jan 2017 10:58:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAw825014006; Sat, 14 Jan 2017 10:58:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141058.v0EAw825014006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312168 - in stable/10: share/man/man4 sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:58:10 -0000 Author: arybchik Date: Sat Jan 14 10:58:08 2017 New Revision: 312168 URL: https://svnweb.freebsd.org/changeset/base/312168 Log: MFC r311977 sfxge(4): add tunable to configure MAC stats update period Sponsored by: Solarflare Communications, Inc. Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:58:08 2017 (r312168) @@ -158,6 +158,14 @@ port will be the value of .Va hw.sfxge.mcdi_logging. The logging may also be enabled or disabled after the driver is loaded using the sysctl .Va dev.sfxge.%d.mcdi_logging. +.It Va hw.sfxge.stats_update_period_ms +Period in milliseconds to refresh interface statistics from hardware. +The accepted range is 0 to 65535, the default is 1000 (1 second). +Use zero value to disable periodic statistics update. +Supported on SFN8xxx series adapters with firmware v6.2.1.1033 and later and +SFN5xxx and SFN6xxx series adapters. +SFN7xxx series adapters and SFN8xxx series with earlier firmware use a +fixed 1000 milliseconds statistics update period. .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/sys/dev/sfxge/sfxge.c Sat Jan 14 10:58:08 2017 (r312168) @@ -550,7 +550,8 @@ sfxge_tick(void *arg) sfxge_port_update_stats(sc); sfxge_tx_update_stats(sc); - callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, + callout_reset(&sc->tick_callout, + hz * sc->port.stats_update_period_ms / 1000, sfxge_tick, sc); } @@ -615,7 +616,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; - callout_reset(&sc->tick_callout, hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000, + callout_reset(&sc->tick_callout, + hz * sc->port.stats_update_period_ms / 1000, sfxge_tick, sc); return (0); Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/sys/dev/sfxge/sfxge.h Sat Jan 14 10:58:08 2017 (r312168) @@ -247,6 +247,7 @@ struct sfxge_port { #endif struct sfxge_hw_stats phy_stats; struct sfxge_hw_stats mac_stats; + uint16_t stats_update_period_ms; efx_link_mode_t link_mode; uint8_t mcast_addrs[EFX_MAC_MULTICAST_LIST_MAX * EFX_MAC_ADDR_LEN]; Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:50:45 2017 (r312167) +++ stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:58:08 2017 (r312168) @@ -43,6 +43,15 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" +#define SFXGE_PARAM_STATS_UPDATE_PERIOD_MS \ + SFXGE_PARAM(stats_update_period_ms) +static int sfxge_stats_update_period_ms = SFXGE_STATS_UPDATE_PERIOD_MS; +TUNABLE_INT(SFXGE_PARAM_STATS_UPDATE_PERIOD_MS, + &sfxge_stats_update_period_ms); +SYSCTL_INT(_hw_sfxge, OID_AUTO, stats_update_period_ms, CTLFLAG_RDTUN, + &sfxge_stats_update_period_ms, 0, + "netstat interface statistics update period in milliseconds"); + static int sfxge_phy_cap_mask(struct sfxge_softc *, int, uint32_t *); static int @@ -62,7 +71,7 @@ sfxge_mac_stat_update(struct sfxge_softc goto out; } - min_ticks = (unsigned int)hz * SFXGE_STATS_UPDATE_PERIOD_MS / 1000; + min_ticks = (unsigned int)hz * port->stats_update_period_ms / 1000; now = ticks; if ((unsigned int)(now - port->mac_stats.update_time) < min_ticks) { @@ -488,7 +497,7 @@ sfxge_port_start(struct sfxge_softc *sc) /* Update MAC stats by DMA every period */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - SFXGE_STATS_UPDATE_PERIOD_MS, + port->stats_update_period_ms, B_FALSE)) != 0) goto fail6; @@ -646,6 +655,26 @@ sfxge_port_fini(struct sfxge_softc *sc) port->sc = NULL; } +static uint16_t +sfxge_port_stats_update_period_ms(struct sfxge_softc *sc) +{ + int period_ms = sfxge_stats_update_period_ms; + + if (period_ms < 0) { + device_printf(sc->dev, + "treat negative stats update period %d as 0 (disable)\n", + period_ms); + period_ms = 0; + } else if (period_ms > UINT16_MAX) { + device_printf(sc->dev, + "treat too big stats update period %d as %u\n", + period_ms, UINT16_MAX); + period_ms = UINT16_MAX; + } + + return period_ms; +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -694,6 +723,7 @@ sfxge_port_init(struct sfxge_softc *sc) M_SFXGE, M_WAITOK | M_ZERO); if ((rc = sfxge_dma_alloc(sc, EFX_MAC_STATS_SIZE, mac_stats_buf)) != 0) goto fail2; + port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); port->init_state = SFXGE_PORT_INITIALIZED; From owner-svn-src-stable-10@freebsd.org Sat Jan 14 10:59:27 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115C2CAE115; Sat, 14 Jan 2017 10:59:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6586185B; Sat, 14 Jan 2017 10:59:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EAxPvK014122; Sat, 14 Jan 2017 10:59:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EAxPIX014120; Sat, 14 Jan 2017 10:59:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701141059.v0EAxPIX014120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 Jan 2017 10:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312169 - in stable/10: share/man/man4 sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 10:59:27 -0000 Author: arybchik Date: Sat Jan 14 10:59:25 2017 New Revision: 312169 URL: https://svnweb.freebsd.org/changeset/base/312169 Log: MFC r311983 sfxge(4): add sysctl to change MAC stats update period The sysctl controls the period per interface. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:58:08 2017 (r312168) +++ stable/10/share/man/man4/sfxge.4 Sat Jan 14 10:59:25 2017 (r312169) @@ -166,6 +166,8 @@ Supported on SFN8xxx series adapters wit SFN5xxx and SFN6xxx series adapters. SFN7xxx series adapters and SFN8xxx series with earlier firmware use a fixed 1000 milliseconds statistics update period. +The period may also be changed after the driver is loaded using the sysctl +.Va dev.sfxge.%d.stats_update_period_ms . .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:58:08 2017 (r312168) +++ stable/10/sys/dev/sfxge/sfxge_port.c Sat Jan 14 10:59:25 2017 (r312169) @@ -675,6 +675,48 @@ sfxge_port_stats_update_period_ms(struct return period_ms; } +static int +sfxge_port_stats_update_period_ms_handler(SYSCTL_HANDLER_ARGS) +{ + struct sfxge_softc *sc; + struct sfxge_port *port; + unsigned int period_ms; + int error; + + sc = arg1; + port = &sc->port; + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &period_ms, sizeof(period_ms)); + if (error != 0) + return (error); + + if (period_ms > UINT16_MAX) + return (EINVAL); + + SFXGE_PORT_LOCK(port); + + if (port->stats_update_period_ms != period_ms) { + if (port->init_state == SFXGE_PORT_STARTED) + error = efx_mac_stats_periodic(sc->enp, + &port->mac_stats.dma_buf, + period_ms, B_FALSE); + if (error == 0) + port->stats_update_period_ms = period_ms; + } + + SFXGE_PORT_UNLOCK(port); + } else { + SFXGE_PORT_LOCK(port); + period_ms = port->stats_update_period_ms; + SFXGE_PORT_UNLOCK(port); + + error = SYSCTL_OUT(req, &period_ms, sizeof(period_ms)); + } + + return (error); +} + int sfxge_port_init(struct sfxge_softc *sc) { @@ -726,6 +768,11 @@ sfxge_port_init(struct sfxge_softc *sc) port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "stats_update_period_ms", CTLTYPE_UINT|CTLFLAG_RW, sc, 0, + sfxge_port_stats_update_period_ms_handler, "IU", + "interface statistics refresh period"); + port->init_state = SFXGE_PORT_INITIALIZED; DBGPRINT(sc->dev, "success"); From owner-svn-src-stable-10@freebsd.org Sat Jan 14 11:27:12 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A9ACAEBEB; Sat, 14 Jan 2017 11:27:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76E2017A0; Sat, 14 Jan 2017 11:27:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EBRBOG026216; Sat, 14 Jan 2017 11:27:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EBRBKI026215; Sat, 14 Jan 2017 11:27:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701141127.v0EBRBKI026215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Jan 2017 11:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312171 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 11:27:12 -0000 Author: kib Date: Sat Jan 14 11:27:11 2017 New Revision: 312171 URL: https://svnweb.freebsd.org/changeset/base/312171 Log: MFC r311646: Define _POSIX_PRIORITY_SCHEDULING as 0, to account for the kernel option. Modified: stable/10/sys/sys/unistd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/unistd.h ============================================================================== --- stable/10/sys/sys/unistd.h Sat Jan 14 11:16:10 2017 (r312170) +++ stable/10/sys/sys/unistd.h Sat Jan 14 11:27:11 2017 (r312171) @@ -65,7 +65,7 @@ #define _POSIX_MONOTONIC_CLOCK 200112L #define _POSIX_NO_TRUNC 1 #define _POSIX_PRIORITIZED_IO (-1) -#define _POSIX_PRIORITY_SCHEDULING 200112L +#define _POSIX_PRIORITY_SCHEDULING 0 #define _POSIX_RAW_SOCKETS 200112L #define _POSIX_REALTIME_SIGNALS 200112L #define _POSIX_SEMAPHORES 200112L From owner-svn-src-stable-10@freebsd.org Sat Jan 14 15:43:33 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39DDCCAD403; Sat, 14 Jan 2017 15:43:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E489A1E3D; Sat, 14 Jan 2017 15:43:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EFhWxQ031590; Sat, 14 Jan 2017 15:43:32 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFhWuA031589; Sat, 14 Jan 2017 15:43:32 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701141543.v0EFhWuA031589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 15:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312186 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:43:33 -0000 Author: np Date: Sat Jan 14 15:43:31 2017 New Revision: 312186 URL: https://svnweb.freebsd.org/changeset/base/312186 Log: MFC r311831 and r311832. r311831: cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved in work requests that end at the end of the descriptor ring, even though the pidx wraps around to 0. r311832: cxgbe(4): Enable automatic cidx flush for all control queues. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Sat Jan 14 15:43:04 2017 (r312185) +++ stable/10/sys/dev/cxgbe/t4_sge.c Sat Jan 14 15:43:31 2017 (r312186) @@ -2289,7 +2289,7 @@ slowpath: w = &eq->desc[eq->pidx]; IDXINCR(eq->pidx, ndesc, eq->sidx); - if (__predict_false(eq->pidx < ndesc - 1)) { + if (__predict_false(cookie->pidx + ndesc > eq->sidx)) { w = &wrq->ss[0]; wrq->ss_pidx = cookie->pidx; wrq->ss_len = len16 * 16; @@ -3296,12 +3296,13 @@ ctrl_eq_alloc(struct adapter *sc, struct c.cmpliqid_eqid = htonl(V_FW_EQ_CTRL_CMD_CMPLIQID(eq->iqid)); c.physeqid_pkd = htobe32(0); c.fetchszm_to_iqid = - htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | + htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); From owner-svn-src-stable-10@freebsd.org Sat Jan 14 15:53:00 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4A6ECAD914; Sat, 14 Jan 2017 15:53:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8034A1641; Sat, 14 Jan 2017 15:53:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0EFqxn9035572; Sat, 14 Jan 2017 15:52:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0EFqxED035570; Sat, 14 Jan 2017 15:52:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701141552.v0EFqxED035570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Jan 2017 15:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312188 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2017 15:53:00 -0000 Author: np Date: Sat Jan 14 15:52:59 2017 New Revision: 312188 URL: https://svnweb.freebsd.org/changeset/base/312188 Log: MFC r311848: cxgbe(4): Attach to the 2x25 debug card. This is for internal use only. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sat Jan 14 15:52:56 2017 (r312187) +++ stable/10/sys/dev/cxgbe/t4_main.c Sat Jan 14 15:52:59 2017 (r312188) @@ -611,6 +611,7 @@ struct { #endif }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ + {0x6400, "Chelsio T6225-DBG"}, /* 2 x 10/25G, debug */ {0x6401, "Chelsio T6225-CR"}, /* 2 x 10/25G */ {0x6402, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ {0x6407, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */