svn commit: r253596 - head/sys/kern
Author: glebius Date: Wed Jul 24 08:02:56 2013 New Revision: 253596 URL: http://svnweb.freebsd.org/changeset/base/253596 Log: Remove unused argument from vmem_add1(). Reviewed by: jeff Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c == --- head/sys/kern/subr_vmem.c Wed Jul 24 07:48:08 2013(r253595) +++ head/sys/kern/subr_vmem.c Wed Jul 24 08:02:56 2013(r253596) @@ -650,7 +650,7 @@ vmem_start_callout(void *unused) SYSINIT(vfs, SI_SUB_CONFIGURE, SI_ORDER_ANY, vmem_start_callout, NULL); static void -vmem_add1(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int flags, int type) +vmem_add1(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int type) { bt_t *btspan; bt_t *btfree; @@ -726,7 +726,7 @@ vmem_import(vmem_t *vm, vmem_size_t size if (error) return ENOMEM; - vmem_add1(vm, addr, size, flags, BT_TYPE_SPAN); + vmem_add1(vm, addr, size, BT_TYPE_SPAN); return 0; } @@ -1176,7 +1176,7 @@ vmem_add(vmem_t *vm, vmem_addr_t addr, v flags &= VMEM_FLAGS; VMEM_LOCK(vm); if (vm->vm_nfreetags >= BT_MAXALLOC || bt_fill(vm, flags) == 0) - vmem_add1(vm, addr, size, flags, BT_TYPE_SPAN_STATIC); + vmem_add1(vm, addr, size, BT_TYPE_SPAN_STATIC); else error = ENOMEM; VMEM_UNLOCK(vm); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253597 - head/sbin/ipfw
Author: se Date: Wed Jul 24 08:36:29 2013 New Revision: 253597 URL: http://svnweb.freebsd.org/changeset/base/253597 Log: Remove duplicated parapgraph. MFC after:3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 == --- head/sbin/ipfw/ipfw.8 Wed Jul 24 08:02:56 2013(r253596) +++ head/sbin/ipfw/ipfw.8 Wed Jul 24 08:36:29 2013(r253597) @@ -3049,16 +3049,6 @@ option could be used to (re)mark user tr by adding the following to the appropriate place in ruleset: .Pp .Dl "ipfw add setdscp be ip from any to any dscp af11,af21" -.Pp -This rule drops all incoming packets that appear to be coming from another -directly connected system but on the wrong interface. -For example, a packet with a source address of -.Li 192.168.0.0/24 , -configured on -.Li fxp0 , -but coming in on -.Li fxp1 -would be dropped. .Ss DYNAMIC RULES In order to protect a site from flood attacks involving fake TCP packets, it is safer to use dynamic rules: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253601 - head/sys/conf
Author: avg Date: Wed Jul 24 09:05:04 2013 New Revision: 253601 URL: http://svnweb.freebsd.org/changeset/base/253601 Log: newvers.sh: fix the fallback case of git-svn detection MFC after:5 days Sponsored by: HybridCluster Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shWed Jul 24 08:56:59 2013(r253600) +++ head/sys/conf/newvers.shWed Jul 24 09:05:04 2013(r253601) @@ -132,7 +132,7 @@ if [ -n "$git_cmd" ] ; then else svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -n $svn ] ; then + if [ -n "$svn" ] ; then svn=" r${svn}" git="+${git}" else ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253602 - head/sys/conf
Author: avg Date: Wed Jul 24 09:06:50 2013 New Revision: 253602 URL: http://svnweb.freebsd.org/changeset/base/253602 Log: newvers.sh: add another git-svn fallback This time it is for a git mirror that stores svn revisions as git notes, e.g. https://github.com/freebsd/freebsd MFC after:10 days Sponsored by: HybridCluster Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shWed Jul 24 09:05:04 2013(r253601) +++ head/sys/conf/newvers.shWed Jul 24 09:06:50 2013(r253602) @@ -132,6 +132,11 @@ if [ -n "$git_cmd" ] ; then else svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -z "$svn" ] ; then + svn=`$git_cmd log --format='format:%N' | \ +grep '^svn ' | head -1 | \ +sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` + fi if [ -n "$svn" ] ; then svn=" r${svn}" git="+${git}" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253603 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Wed Jul 24 09:15:59 2013 New Revision: 253603 URL: http://svnweb.freebsd.org/changeset/base/253603 Log: zfs: move vnode creation from zfs_znode_cache_constructor to zfs_znode_alloc All other places where a znode is allocated do not need z_vnode at all. These are: - zfs_create_share_dir - zfs_create_fs This chnage ensures two things: - VN_LOCK_ASHARE is not erroneously called for VFIFO vnodes - vn_lock is called on a fully constructed vnode with correct v_ops The change also allows to make zfs_znode_cache_constructor a normal kmem_cache constructor again (as it is in upstream). This allows to avoid a problem where zfs_znode_cache_destructor may be called on un-constructed znodes. MFC after:17 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 24 09:06:50 2013(r253602) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 24 09:15:59 2013(r253603) @@ -113,37 +113,12 @@ extern struct vop_vector zfs_vnodeops; extern struct vop_vector zfs_fifoops; extern struct vop_vector zfs_shareops; -/* - * XXX: We cannot use this function as a cache constructor, because - * there is one global cache for all file systems and we need - * to pass vfsp here, which is not possible, because argument - * 'cdrarg' is defined at kmem_cache_create() time. - */ -/*ARGSUSED*/ static int zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) { znode_t *zp = buf; - vnode_t *vp; - vfs_t *vfsp = arg; - int error; POINTER_INVALIDATE(&zp->z_zfsvfs); - ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - - if (vfsp != NULL) { - error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); - if (error != 0 && (kmflags & KM_NOSLEEP)) - return (-1); - ASSERT(error == 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - zp->z_vnode = vp; - vp->v_data = (caddr_t)zp; - VN_LOCK_AREC(vp); - VN_LOCK_ASHARE(vp); - } else { - zp->z_vnode = NULL; - } list_link_init(&zp->z_link_node); @@ -158,6 +133,7 @@ zfs_znode_cache_constructor(void *buf, v zp->z_dirlocks = NULL; zp->z_acl_cached = NULL; + zp->z_vnode = NULL; zp->z_moved = 0; return (0); } @@ -377,7 +353,7 @@ zfs_znode_init(void) rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", - sizeof (znode_t), 0, /* zfs_znode_cache_constructor */ NULL, + sizeof (znode_t), 0, zfs_znode_cache_constructor, zfs_znode_cache_destructor, NULL, NULL, NULL, 0); kmem_cache_set_move(znode_cache, zfs_znode_move); } @@ -501,7 +477,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfs_acl_ids_t acl_ids; vattr_t vattr; znode_t *sharezp; - vnode_t *vp, vnode; znode_t *zp; int error; @@ -512,7 +487,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d vattr.va_gid = crgetgid(kcred); sharezp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(sharezp, zfsvfs->z_parent->z_vfs, 0); ASSERT(!POINTER_IS_VALID(sharezp->z_zfsvfs)); sharezp->z_moved = 0; sharezp->z_unlinked = 0; @@ -520,12 +494,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d sharezp->z_zfsvfs = zfsvfs; sharezp->z_is_sa = zfsvfs->z_use_sa; - sharezp->z_vnode = &vnode; - vnode.v_data = sharezp; - - vp = ZTOV(sharezp); - vp->v_type = VDIR; - VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, kcred, NULL, &acl_ids)); zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE, &zp, &acl_ids); @@ -536,12 +504,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfsvfs->z_shares_dir = sharezp->z_id; zfs_acl_ids_free(&acl_ids); - ZTOV(sharezp)->v_data = NULL; - ZTOV(sharezp)->v_count = 0; - ZTOV(sharezp)->v_holdcnt = 0; - zp->z_vnode = NULL; sa_handle_destroy(sharezp->z_sa_hdl); - sharezp->z_vnode = NULL; kmem_cache_free(znode_cache, sharezp); return (error); @@ -657,9 +620,17 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu uint64_t parent; sa_bulk_attr_t bulk[9]; int count = 0; + int error; zp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(zp, zfsvfs->z_parent->z_vfs, 0); + + error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); + if (error != 0) { + kmem_cache_free
svn commit: r253604 - in head/sys: gdb kern ofed/include/linux sys vm
Author: avg Date: Wed Jul 24 09:45:31 2013 New Revision: 253604 URL: http://svnweb.freebsd.org/changeset/base/253604 Log: rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST Also directly call swapper() at the end of mi_startup instead of relying on swapper being the last thing in sysinits order. Rationale: - "RUN_SCHEDULER" was misleading, scheduling already takes place at that stage - "scheduler" was misleading, the function swaps in the swapped out processes - another SYSINIT(SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY) could never be invoked depending on its relative order with scheduler; this was not obvious and the bug actually used to exist Reviewed by: kib (ealier version) MFC after:14 days Modified: head/sys/gdb/gdb_cons.c head/sys/kern/init_main.c head/sys/kern/kern_ntptime.c head/sys/kern/sched_4bsd.c head/sys/ofed/include/linux/module.h head/sys/sys/kernel.h head/sys/sys/sched.h head/sys/vm/vm.h head/sys/vm/vm_glue.c Modified: head/sys/gdb/gdb_cons.c == --- head/sys/gdb/gdb_cons.c Wed Jul 24 09:15:59 2013(r253603) +++ head/sys/gdb/gdb_cons.c Wed Jul 24 09:45:31 2013(r253604) @@ -136,7 +136,7 @@ oktousecallout(void *data __unused) { calloutok = 1; } -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL); +SYSINIT(gdbhack, SI_SUB_LAST, SI_ORDER_MIDDLE, oktousecallout, NULL); static void gdb_cnputc(struct consdev *cp, int c) Modified: head/sys/kern/init_main.c == --- head/sys/kern/init_main.c Wed Jul 24 09:15:59 2013(r253603) +++ head/sys/kern/init_main.c Wed Jul 24 09:45:31 2013(r253604) @@ -243,9 +243,6 @@ restart: /* * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. -* -* The last item on the list is expected to be the scheduler, -* which will not return. */ for (sipp = sysinit; sipp < sysinit_end; sipp++) { @@ -303,7 +300,13 @@ restart: } } - panic("Shouldn't get here!"); + mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); + mtx_unlock(&Giant); + + /* +* Now hand over this thread to swapper. +*/ + swapper(); /* NOTREACHED*/ } @@ -346,7 +349,7 @@ static char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 1, +SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); #endif @@ -355,7 +358,7 @@ static char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 2, +SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); #endif Modified: head/sys/kern/kern_ntptime.c == --- head/sys/kern/kern_ntptime.cWed Jul 24 09:15:59 2013 (r253603) +++ head/sys/kern/kern_ntptime.cWed Jul 24 09:45:31 2013 (r253604) @@ -1051,5 +1051,5 @@ start_periodic_resettodr(void *arg __unu periodic_resettodr, NULL); } -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, +SYSINIT(periodic_resettodr, SI_SUB_LAST, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL); Modified: head/sys/kern/sched_4bsd.c == --- head/sys/kern/sched_4bsd.c Wed Jul 24 09:15:59 2013(r253603) +++ head/sys/kern/sched_4bsd.c Wed Jul 24 09:45:31 2013(r253604) @@ -143,7 +143,7 @@ static struct kproc_desc sched_kp = { schedcpu_thread, NULL }; -SYSINIT(schedcpu, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, kproc_start, +SYSINIT(schedcpu, SI_SUB_LAST, SI_ORDER_FIRST, kproc_start, &sched_kp); SYSINIT(sched_setup, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, sched_setup, NULL); Modified: head/sys/ofed/include/linux/module.h == --- head/sys/ofed/include/linux/module.hWed Jul 24 09:15:59 2013 (r253603) +++ head/sys/ofed/include/linux/module.hWed Jul 24 09:45:31 2013 (r253604) @@ -68,17 +68,17 @@ _module_run(void *arg) } #definemodule_init(fn) \ - SYSINIT(fn, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, _module_run, (fn)) + SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) /* * XXX This is a freebsdism designed
svn commit: r253605 - head/tools/tools/zfsboottest
Author: avg Date: Wed Jul 24 09:50:44 2013 New Revision: 253605 URL: http://svnweb.freebsd.org/changeset/base/253605 Log: zfsboottest: remove explicit -Werror Unfortunately sys/boot is compliled without -Werror at the moment. MFC after:7 days Modified: head/tools/tools/zfsboottest/Makefile Modified: head/tools/tools/zfsboottest/Makefile == --- head/tools/tools/zfsboottest/Makefile Wed Jul 24 09:45:31 2013 (r253604) +++ head/tools/tools/zfsboottest/Makefile Wed Jul 24 09:50:44 2013 (r253605) @@ -15,8 +15,7 @@ CFLAGS= -O1 \ -I${.CURDIR}/../../../sys/cddl/boot/zfs \ -I. \ -fdiagnostics-show-option \ - -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ - -Werror + -W -Wextra -Wno-sign-compare -Wno-unused-parameter LDFLAGS+=-lmd .if ${MACHINE_CPUARCH} == "amd64" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253606 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Wed Jul 24 09:59:16 2013 New Revision: 253606 URL: http://svnweb.freebsd.org/changeset/base/253606 Log: zfs module: perform cleanup during shutdown in addition to module unload - move init and fini code into separate functions (like it is done upstream) - invoke fini code via shutdown_post_sync event hook This should make zfs close its underlying devices during shutdown, which may be important for their drivers. MFC after:20 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jul 24 09:50:44 2013(r253605) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jul 24 09:59:16 2013(r253606) @@ -6187,54 +6187,96 @@ _info(struct modinfo *modinfop) } #endif /* sun */ -static int -zfs_modevent(module_t mod, int type, void *unused __unused) +static int zfs__init(void); +static int zfs__fini(void); +static void zfs_shutdown(void *, int); + +static eventhandler_tag zfs_shutdown_event_tag; + +int +zfs__init(void) { - int error = 0; - switch (type) { - case MOD_LOAD: - zfs_root_token = root_mount_hold("ZFS"); + zfs_root_token = root_mount_hold("ZFS"); - mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); - spa_init(FREAD | FWRITE); - zfs_init(); - zvol_init(); - zfs_ioctl_init(); + spa_init(FREAD | FWRITE); + zfs_init(); + zvol_init(); + zfs_ioctl_init(); - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, rrw_tsd_destroy); - tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); + tsd_create(&zfs_fsyncer_key, NULL); + tsd_create(&rrw_tsd_key, rrw_tsd_destroy); + tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); - printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); - root_mount_rel(zfs_root_token); + printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); + root_mount_rel(zfs_root_token); - zfsdev_init(); - break; - case MOD_UNLOAD: - if (spa_busy() || zfs_busy() || zvol_busy() || - zio_injection_enabled) { - error = EBUSY; - break; - } - - zfsdev_fini(); - zvol_fini(); - zfs_fini(); - spa_fini(); - - tsd_destroy(&zfs_fsyncer_key); - tsd_destroy(&rrw_tsd_key); - tsd_destroy(&zfs_allow_log_key); + zfsdev_init(); - mutex_destroy(&zfs_share_lock); - break; + return (0); +} + +int +zfs__fini(void) +{ + if (spa_busy() || zfs_busy() || zvol_busy() || + zio_injection_enabled) { + return (EBUSY); + } + + zfsdev_fini(); + zvol_fini(); + zfs_fini(); + spa_fini(); + + tsd_destroy(&zfs_fsyncer_key); + tsd_destroy(&rrw_tsd_key); + tsd_destroy(&zfs_allow_log_key); + + mutex_destroy(&zfs_share_lock); + + return (0); +} + +static void +zfs_shutdown(void *arg __unused, int howto __unused) +{ + + /* +* ZFS fini routines can not properly work in a panic-ed system. +*/ + if (panicstr == NULL) + (void)zfs__fini(); +} + + +static int +zfs_modevent(module_t mod, int type, void *unused __unused) +{ + int err; + + switch (type) { + case MOD_LOAD: + err = zfs__init(); + if (err == 0) + zfs_shutdown_event_tag = EVENTHANDLER_REGISTER( + shutdown_post_sync, zfs_shutdown, NULL, + SHUTDOWN_PRI_FIRST); + return (err); + case MOD_UNLOAD: + err = zfs__fini(); + if (err == 0 && zfs_shutdown_event_tag != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, + zfs_shutdown_event_tag); + return (err); + case MOD_SHUTDOWN: + return (0); default: - error = EOPNOTSUPP; break; } - return (error); + return (EOPNOTSUPP); } static moduledata_t zfs_mod = { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253504 - head/sbin/route
On Jul 24, 2013, at 06:06, Hiroki Sato wrote: > Dimitry Andric wrote > in <36e48152-1a64-432d-a32d-75059a56e...@freebsd.org>: ... > di> This breaks /etc/rc.d/defaultroute, since it relies on "route -n get > di> -inet default" printing a line with "interface:" in it. ... > Should be fixed in r253589. Sorry for the breakage. It works fine now. Thanks for the quick fix! -Dimitry ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253457 - head/usr.bin/uniq
On Thu, 2013-07-18 at 22:11:27 +, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Jul 18 22:11:27 2013 > New Revision: 253457 > URL: http://svnweb.freebsd.org/changeset/base/253457 > > Log: > Close uniq(1) in the capability mode sandbox and limit descriptors using > capability rights. > > Modified: > head/usr.bin/uniq/uniq.c > > Modified: head/usr.bin/uniq/uniq.c > == > --- head/usr.bin/uniq/uniq.c Thu Jul 18 21:56:10 2013(r253456) > +++ head/usr.bin/uniq/uniq.c Thu Jul 18 22:11:27 2013(r253457) > @@ -128,8 +145,34 @@ main (int argc, char *argv[]) > ofp = stdout; > if (argc > 0 && strcmp(argv[0], "-") != 0) > ifp = file(ifn = argv[0], "r"); > + if (cap_rights_limit(fileno(ifp), CAP_FSTAT | CAP_READ) < 0 && > + errno != ENOSYS) { > + err(1, "unable to limit rights for %s", ifn); > + } > + rights = CAP_FSTAT | CAP_WRITE; > if (argc > 1) > ofp = file(argv[1], "w"); > + else > + rights |= CAP_IOCTL; > + if (cap_rights_limit(fileno(ofp), rights) < 0 && errno != ENOSYS) { > + err(1, "unable to limit rights for %s", > + argc > 1 ? argv[1] : "stdout"); > + } > + if ((rights & CAP_IOCTL) != 0) { > + unsigned long cmd; > + > + cmd = TIOCGETA; /* required by isatty(3) in printf(3) */ > + > + if (cap_ioctls_limit(fileno(ofp), &cmd, 1) < 0 && > + errno != ENOSYS) { > + err(1, "unable to limit ioctls for %s", > + argc > 1 ? argv[1] : "stdout"); > + } > + } Deadcode, found by Coverity Scan, CID 1054780 (please mention in your fix-commit). You check for argc > 1 at line 153, only if that is false (meaning argc==1) do you set CAP_IOCTL. So on line 169 argc cannot be >1 and the result is always "stdout". Cheers, Uli ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253504 - head/sbin/route
On Sat, 2013-07-20 at 16:46:51 +, Hiroki Sato wrote: > Author: hrs > Date: Sat Jul 20 16:46:51 2013 > New Revision: 253504 > URL: http://svnweb.freebsd.org/changeset/base/253504 > > Log: > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* > as the argument. > - Reduce unnecessary loop in print_getmsg(). > > Modified: > head/sbin/route/route.c > > Modified: head/sbin/route/route.c > == > --- head/sbin/route/route.c Sat Jul 20 15:58:43 2013(r253503) > +++ head/sbin/route/route.c Sat Jul 20 16:46:51 2013(r253504) > @@ -1105,7 +1105,7 @@ inet6_makenetandmask(struct sockaddr_in6 > * returning 1 if a host address, 0 if a network address. > */ > static int > -getaddr(int which, char *str, struct hostent **hpp, int nrflags) > +getaddr(int idx, char *str, struct hostent **hpp, int nrflags) > { > struct sockaddr *sa; > #if defined(INET) > @@ -1130,36 +1130,16 @@ getaddr(int which, char *str, struct hos > aflen = sizeof(struct sockaddr_dl); > #endif > } > - rtm_addrs |= which; > + rtm_addrs |= (1 << idx); > > - switch (which) { > - case RTA_DST: > - sa = (struct sockaddr *)&so[RTAX_DST]; > - break; > - case RTA_GATEWAY: > - sa = (struct sockaddr *)&so[RTAX_GATEWAY]; > - break; > - case RTA_NETMASK: > - sa = (struct sockaddr *)&so[RTAX_NETMASK]; > - break; > - case RTA_GENMASK: > - sa = (struct sockaddr *)&so[RTAX_GENMASK]; > - break; > - case RTA_IFA: > - sa = (struct sockaddr *)&so[RTAX_IFA]; > - break; > - case RTA_IFP: > - sa = (struct sockaddr *)&so[RTAX_IFP]; > - break; > - default: > + if (idx > RTAX_MAX) > usage("internal error"); > - /*NOTREACHED*/ > - } > + sa = (struct sockaddr *)&so[idx]; Coverity Scan flags this as an out-of-bounds write. RTAX_MAX is 8, so idx can be up to 8 (inclusive) in the check above. Do you want to check for idx >= RTAX_MAX maybe? idx is also signed ... Coverity CID is 1054779, btw. Cheers, Uli ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253611 - head/sys/dev/iwn
Author: adrian Date: Wed Jul 24 13:20:45 2013 New Revision: 253611 URL: http://svnweb.freebsd.org/changeset/base/253611 Log: Add new IDs for The Intel 2230 wireless NIC. Submitted by: Cedric GROSS Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:07:29 2013(r253610) +++ head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:20:45 2013(r253611) @@ -93,6 +93,8 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0091, "Intel Centrino Advanced-N 6230" }, { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 2230" }, + { 0x8086, 0x0888, "Intel Centrino Wireless-N 2230" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, { 0x8086, 0x0897, "Intel Centrino Wireless-N 130" }, { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253612 - head/sys/dev/iwn
Author: adrian Date: Wed Jul 24 13:31:31 2013 New Revision: 253612 URL: http://svnweb.freebsd.org/changeset/base/253612 Log: Support setting up the iwn debug flags during probe/attach by checking "hint.iwn.X.debug". Submitted by: Cedric GROSS Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:20:45 2013(r253611) +++ head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:31:31 2013(r253612) @@ -447,6 +447,15 @@ iwn_attach(device_t dev) sc->sc_dev = dev; +#ifdef IWN_DEBUG + error = resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "debug", &(sc->sc_debug)); + if (error != 0) + sc->sc_debug = 0; +#else + sc->sc_debug = 0; +#endif + /* * Get the offset of the PCI Express Capability Structure in PCI * Configuration Space. @@ -846,13 +855,13 @@ iwn_radiotap_attach(struct iwn_softc *sc static void iwn_sysctlattach(struct iwn_softc *sc) { +#ifdef IWN_DEBUG struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); -#ifdef IWN_DEBUG - sc->sc_debug = 0; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging printfs"); + "debug", CTLFLAG_RW, &sc->sc_debug, sc->sc_debug, + "control debugging printfs"); #endif } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253351 - in head: sys/arm/arm sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/netstat
On Mon, 2013-07-15 at 06:16:57 +, Andrey V. Elsukov wrote: > Author: ae > Date: Mon Jul 15 06:16:57 2013 > New Revision: 253351 > URL: http://svnweb.freebsd.org/changeset/base/253351 > > Log: > Introduce new structure sfstat for collecting sendfile's statistics > and remove corresponding fields from struct mbstat. Use PCPU counters > and SFSTAT_INC() macro for update these statistics. > > Discussed with: glebius > > Modified: > head/sys/arm/arm/vm_machdep.c > head/sys/i386/i386/vm_machdep.c > head/sys/kern/kern_mbuf.c > head/sys/kern/uipc_syscalls.c > head/sys/mips/mips/vm_machdep.c > head/sys/powerpc/aim/vm_machdep.c > head/sys/powerpc/booke/vm_machdep.c > head/sys/sparc64/sparc64/vm_machdep.c > head/sys/sys/mbuf.h > head/sys/sys/sf_buf.h > head/usr.bin/netstat/main.c > head/usr.bin/netstat/mbuf.c > > Modified: head/usr.bin/netstat/mbuf.c > == > --- head/usr.bin/netstat/mbuf.c Mon Jul 15 05:09:13 2013 > (r253350) > +++ head/usr.bin/netstat/mbuf.c Mon Jul 15 06:16:57 2013 > (r253351) > @@ -308,20 +309,21 @@ mbpr(void *kvmd, u_long mbaddr) > &mlen, NULL, 0)) > printf("%d/%d/%d sfbufs in use (current/peak/max)\n", > nsfbufsused, nsfbufspeak, nsfbufs); > - mlen = sizeof(mbstat); > - if (sysctlbyname("kern.ipc.mbstat", &mbstat, &mlen, NULL, 0)) { > - warn("kern.ipc.mbstat"); > + mlen = sizeof(sfstat); > + if (sysctlbyname("kern.ipc.sfstat", &sfstat, &mlen, NULL, 0)) { > + warn("kern.ipc.sfstat"); > goto out; > } > } else { Hmm, Coverity flags the sysctlbyname() as an OVERRUN, claiming: overrun-buffer-val: Overrunning struct type sfstat of 24 bytes by passing it to a function which accesses it at byte offset 37. So sysctlbyname.c basically calls sysctl(3) and Coverity thinks that name[1] is USER_CS_PATH in this case, entering the case statement on line 69, which then clobbers oldlenp with sizeof(_PATH_STDPATH) at line 74 in lib/libc/gen/sysctl.c, which is 37 bytes (sizeof("/rescue:/usr/bin:/bin:/usr/sbin:/sbin")). Then it calls memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); where the oldp only has space for the aforementioned 24 bytes of struct sfstat. Any thoughts on this? It's CID 1054778 at scan.coverity.com, if you wanna have a look yourself. Cheers, Uli ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253614 - head/usr.bin/patch
Author: pfg Date: Wed Jul 24 15:46:49 2013 New Revision: 253614 URL: http://svnweb.freebsd.org/changeset/base/253614 Log: patch: style fix Submitted by: gogolok Modified: head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.c == --- head/usr.bin/patch/patch.c Wed Jul 24 13:43:09 2013(r253613) +++ head/usr.bin/patch/patch.c Wed Jul 24 15:46:49 2013(r253614) @@ -239,8 +239,10 @@ main(int argc, char *argv[]) if (!skip_rest_of_patch) scan_input(filearg[0]); - /* from here on, open no standard i/o files, because malloc */ - /* might misfire and we can't catch it easily */ + /* +* from here on, open no standard i/o files, because +* malloc might misfire and we can't catch it easily +*/ /* apply each hunk of patch */ hunk = 0; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253615 - head/sys/kern
Author: marcel Date: Wed Jul 24 16:22:27 2013 New Revision: 253615 URL: http://svnweb.freebsd.org/changeset/base/253615 Log: In uuid_ether_add(), avoid false positives due to the limited type used to hold the sum of the bytes of the MAC address. While here, rename the variable that holds the sum from 'c' to 'sum'. Pointed out by: thompsa@ Modified: head/sys/kern/kern_uuid.c Modified: head/sys/kern/kern_uuid.c == --- head/sys/kern/kern_uuid.c Wed Jul 24 15:46:49 2013(r253614) +++ head/sys/kern/kern_uuid.c Wed Jul 24 16:22:27 2013(r253615) @@ -200,8 +200,7 @@ sys_uuidgen(struct thread *td, struct uu int uuid_ether_add(const uint8_t *addr) { - int i; - uint8_t c; + int i, sum; /* * Validate input. No multicast addresses and no addresses that @@ -209,10 +208,10 @@ uuid_ether_add(const uint8_t *addr) */ if (addr[0] & 0x01) return (EINVAL); - c = 0; + sum = 0; for (i = 0; i < UUID_NODE_LEN; i++) - c += addr[i]; - if (c == 0) + sum += addr[i]; + if (sum == 0) return (EINVAL); mtx_lock(&uuid_mutex); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253614 - head/usr.bin/patch
On Wed, Jul 24, 2013 at 03:46:50PM +, Pedro F. Giffuni wrote: > New Revision: 253614 > URL: http://svnweb.freebsd.org/changeset/base/253614 > > Log: > patch: style fix It's still broken: bad use of capital letters (lack thereof), missing full stop (terminating dot). > Submitted by: gogolok $ finger gogo...@freebsd.org [...] finger: gogolok: no such user ?? ./danfe ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253616 - head
Author: sjg Date: Wed Jul 24 17:55:08 2013 New Revision: 253616 URL: http://svnweb.freebsd.org/changeset/base/253616 Log: Fix bug in universe where if upgrade_checks wants a new make, it gets built 16 times in parallel in the same location. While we are at it, until we finish getting rid of fmake, be explicit about the make we want to use, thus avoid the problem of the temp make being the wrong version. Reviewed by: obrien Modified: head/Makefile Modified: head/Makefile == --- head/Makefile Wed Jul 24 16:22:27 2013(r253615) +++ head/Makefile Wed Jul 24 17:55:08 2013(r253616) @@ -130,11 +130,34 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH .error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ (in make.conf(5)) or command-line variable. .endif -MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} -BINMAKE= \ - `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ + +# We often need to use the tree's version of make to build it. +# Choices add to complexity though. +# We cannot blindly use a make which may not be the one we want +# so be exlicit - until all choice is removed. +.if !defined(WITHOUT_BMAKE) +WANT_MAKE= bmake +.else +WANT_MAKE= fmake +.endif +MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} +.if defined(.PARSEDIR) +HAVE_MAKE= bmake +.else +HAVE_MAKE= fmake +.endif +.if exists(${MYMAKE}) +SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk +.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" +# It may not exist yet but we may cause it to. +# In the case of fmake, upgrade_checks may cause a newer version to be built. +SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ -m ${.CURDIR}/share/mk -_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.else +SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk +.endif + +_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) @@ -291,11 +314,13 @@ kernel: buildkernel installkernel # Perform a few tests to determine if the installed tools are adequate # for building the world. # +# Note: if we ever need to care about the version of bmake, simply testing +# MAKE_VERSION against a required version should suffice. +# upgrade_checks: -.if !defined(.PARSEDIR) -.if !defined(WITHOUT_BMAKE) - (cd ${.CURDIR} && ${MAKE} bmake) -.else +.if ${HAVE_MAKE} != ${WANT_MAKE} + @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) +.elif ${WANT_MAKE} == "fmake" @if ! (cd ${.CURDIR}/tools/build/make_check && \ PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ @@ -303,14 +328,13 @@ upgrade_checks: (cd ${.CURDIR} && ${MAKE} make); \ fi .endif -.endif # # Upgrade make(1) to the current version using the installed # headers, libraries and tools. Also, allow the location of # the system bsdmake-like utility to be overridden. # -MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ +MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ @@ -327,7 +351,7 @@ make bmake: .PHONY ${MMAKE} obj && \ ${MMAKE} depend && \ ${MMAKE} all && \ - ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= + ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= PROGNAME=${MYMAKE:T} tinderbox: @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe @@ -377,7 +401,8 @@ MAKEFAIL=tee -a ${FAILFILE} MAKEFAIL=cat .endif -universe: universe_prologue upgrade_checks +universe_prologue: upgrade_checks +universe: universe_prologue universe_prologue: @echo "--" @echo ">>> make universe started on ${STARTTIME}" @@ -387,9 +412,9 @@ universe_prologue: .endif .for target in ${TARGETS} universe: universe_${target} -.ORDER: universe_prologue upgrade_checks universe_${target} universe_epilogue +universe_epilogue: universe_${target} universe_${target}: universe_${target}_prologue -universe_${target}_prologue: +universe_${target}_prologue: universe_prologue @echo ">> ${target} started on `LC_ALL=C date`" .if !defined(MAKE_JUST_KERNELS) .for target_arch in ${TARGET_ARCHES_${target}} @@ -397,7 +422,7 @@ universe_${target}: universe_${target}_$ universe_${target}_${target_arch}: universe_${target}_prologue @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ - ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ +
svn commit: r253617 - head/sys/kern
Author: marcel Date: Wed Jul 24 18:13:43 2013 New Revision: 253617 URL: http://svnweb.freebsd.org/changeset/base/253617 Log: Further restrict the MAC addresses that we use for UUID generation to those that are universally administered. While it is possible to add locally administered MAC addresses, it's unclear whether those are (expected) to be more unique than random multicast MAC addresses or not. With many U-Boot configurations assigning fixed and non-official MAC addresses to ethernet ports and without setting the 'X' flag, this change may have very little value in the embedded (development) space. Uniqueness of the universally administered addresses is non- existent on the (H/W) bench and questionable under the (S/W) desk. In short: this change is aimed at production environments... Modified: head/sys/kern/kern_uuid.c Modified: head/sys/kern/kern_uuid.c == --- head/sys/kern/kern_uuid.c Wed Jul 24 17:55:08 2013(r253616) +++ head/sys/kern/kern_uuid.c Wed Jul 24 18:13:43 2013(r253617) @@ -203,10 +203,10 @@ uuid_ether_add(const uint8_t *addr) int i, sum; /* -* Validate input. No multicast addresses and no addresses that -* are all zeroes. +* Validate input. No multicast (flag 0x1), no locally administered +* (flag 0x2) and no 'all-zeroes' addresses. */ - if (addr[0] & 0x01) + if (addr[0] & 0x03) return (EINVAL); sum = 0; for (i = 0; i < UUID_NODE_LEN; i++) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253614 - head/usr.bin/patch
El 24/07/2013 11:52 a. m., Alexey Dokuchaev escribió: On Wed, Jul 24, 2013 at 03:46:50PM +, Pedro F. Giffuni wrote: New Revision: 253614 URL: http://svnweb.freebsd.org/changeset/base/253614 Log: patch: style fix It's still broken: bad use of capital letters (lack thereof), missing full stop (terminating dot). All the comments in that file have that same problem. At least now we are consistently inconsistent. Submitted by:gogolok $ finger gogo...@freebsd.org [...] finger: gogolok: no such user ?? @google ... I actually don't have more information about the submitter: https://code.google.com/p/bsd-patch/issues/detail?id=1&can=1 And as soon as I solve the two regressions in the ports tree the google code project is will be killed. Pedro. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253618 - head/sys/dev/usb/gadget
Author: obrien Date: Wed Jul 24 18:32:15 2013 New Revision: 253618 URL: http://svnweb.freebsd.org/changeset/base/253618 Log: per style(9): Kernel include files (i.e. sys/*.h) come first; normally, include OR , but not both. includes , and it is okay to depend on that. Modified: head/sys/dev/usb/gadget/g_audio.c head/sys/dev/usb/gadget/g_keyboard.c head/sys/dev/usb/gadget/g_modem.c head/sys/dev/usb/gadget/g_mouse.c Modified: head/sys/dev/usb/gadget/g_audio.c == --- head/sys/dev/usb/gadget/g_audio.c Wed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_audio.c Wed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,11 +29,12 @@ * http://www.usb.org/developers/devclass_docs/termt10.pdf */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include Modified: head/sys/dev/usb/gadget/g_keyboard.c == --- head/sys/dev/usb/gadget/g_keyboard.cWed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_keyboard.cWed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -28,11 +27,12 @@ * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include Modified: head/sys/dev/usb/gadget/g_modem.c == --- head/sys/dev/usb/gadget/g_modem.c Wed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_modem.c Wed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,11 +29,12 @@ * http://www.usb.org/developers/devclass_docs/cdc_wmc10.zip */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include Modified: head/sys/dev/usb/gadget/g_mouse.c == --- head/sys/dev/usb/gadget/g_mouse.c Wed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_mouse.c Wed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -28,11 +27,12 @@ * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253457 - head/usr.bin/uniq
On Wed, Jul 24, 2013 at 02:53:32PM +0200, Ulrich Spörlein wrote: > On Thu, 2013-07-18 at 22:11:27 +, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Thu Jul 18 22:11:27 2013 > > New Revision: 253457 > > URL: http://svnweb.freebsd.org/changeset/base/253457 > > > > Log: > > Close uniq(1) in the capability mode sandbox and limit descriptors using > > capability rights. > > > > Modified: > > head/usr.bin/uniq/uniq.c > > > > Modified: head/usr.bin/uniq/uniq.c > > == > > --- head/usr.bin/uniq/uniq.cThu Jul 18 21:56:10 2013 > > (r253456) > > +++ head/usr.bin/uniq/uniq.cThu Jul 18 22:11:27 2013 > > (r253457) > > @@ -128,8 +145,34 @@ main (int argc, char *argv[]) > > ofp = stdout; > > if (argc > 0 && strcmp(argv[0], "-") != 0) > > ifp = file(ifn = argv[0], "r"); > > + if (cap_rights_limit(fileno(ifp), CAP_FSTAT | CAP_READ) < 0 && > > + errno != ENOSYS) { > > + err(1, "unable to limit rights for %s", ifn); > > + } > > + rights = CAP_FSTAT | CAP_WRITE; > > if (argc > 1) > > ofp = file(argv[1], "w"); > > + else > > + rights |= CAP_IOCTL; > > + if (cap_rights_limit(fileno(ofp), rights) < 0 && errno != ENOSYS) { > > + err(1, "unable to limit rights for %s", > > + argc > 1 ? argv[1] : "stdout"); > > + } > > + if ((rights & CAP_IOCTL) != 0) { > > + unsigned long cmd; > > + > > + cmd = TIOCGETA; /* required by isatty(3) in printf(3) */ > > + > > + if (cap_ioctls_limit(fileno(ofp), &cmd, 1) < 0 && > > + errno != ENOSYS) { > > + err(1, "unable to limit ioctls for %s", > > + argc > 1 ? argv[1] : "stdout"); > > + } > > + } > > Deadcode, found by Coverity Scan, CID 1054780 (please mention in your > fix-commit). You check for argc > 1 at line 153, only if that is false > (meaning argc==1) do you set CAP_IOCTL. So on line 169 argc cannot be >1 > and the result is always "stdout". Interesting. I was aware of this, but left this err() call for consistency in case the condition changes in the future. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com pgp_69iqZTMmK.pgp Description: PGP signature
svn commit: r253619 - head/sys/fs/fuse
Author: pfg Date: Wed Jul 24 20:21:29 2013 New Revision: 253619 URL: http://svnweb.freebsd.org/changeset/base/253619 Log: fuse: revert kernel_header update. It seems to be causing problems due to the lack of the new features. Found by: bapt Pointed hat: pfg Modified: head/sys/fs/fuse/fuse_kernel.h Modified: head/sys/fs/fuse/fuse_kernel.h == --- head/sys/fs/fuse/fuse_kernel.h Wed Jul 24 18:32:15 2013 (r253618) +++ head/sys/fs/fuse/fuse_kernel.h Wed Jul 24 20:21:29 2013 (r253619) @@ -34,32 +34,14 @@ * $FreeBSD$ */ -/* - * This file defines the kernel interface of FUSE - * - * Protocol changelog: - * - * 7.9: - * - new fuse_getattr_in input argument of GETATTR - * - add lk_flags in fuse_lk_in - * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in - * - add blksize field to fuse_attr - * - add file flags field to fuse_read_in and fuse_write_in - * - * 7.10 - * - add nonseekable open flag - */ - -#ifndef _FS_FUSE_FUSE_KERNEL_H_ -#define _FS_FUSE_FUSE_KERNEL_H_ - #ifndef linux #include #define __u64 uint64_t #define __u32 uint32_t #define __s32 int32_t #else -#include +#include +#include #endif /** Version number of this interface */ @@ -71,6 +53,12 @@ /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 +/** The major number of the fuse character device */ +#define FUSE_MAJOR MISC_MAJOR + +/** The minor number of the fuse character device */ +#define FUSE_MINOR 229 + /* Make sure all structures are padded to 64bit boundary, so 32bit userspace works under 64bit kernels */ @@ -89,8 +77,6 @@ struct fuse_attr { __u32 uid; __u32 gid; __u32 rdev; - __u32 blksize; - __u32 padding; }; struct fuse_kstatfs { @@ -123,62 +109,27 @@ struct fuse_file_lock { #define FATTR_ATIME(1 << 4) #define FATTR_MTIME(1 << 5) #define FATTR_FH (1 << 6) -#define FATTR_ATIME_NOW(1 << 7) -#define FATTR_MTIME_NOW(1 << 8) -#define FATTR_LOCKOWNER(1 << 9) /** * Flags returned by the OPEN request * * FOPEN_DIRECT_IO: bypass page cache for this open file * FOPEN_KEEP_CACHE: don't invalidate the data cache on open - * FOPEN_NONSEEKABLE: the file is not seekable */ #define FOPEN_DIRECT_IO(1 << 0) #define FOPEN_KEEP_CACHE (1 << 1) -#define FOPEN_NONSEEKABLE (1 << 2) /** * INIT request/reply flags - * - * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." */ #define FUSE_ASYNC_READ(1 << 0) #define FUSE_POSIX_LOCKS (1 << 1) -#define FUSE_FILE_OPS (1 << 2) -#define FUSE_ATOMIC_O_TRUNC(1 << 3) -#define FUSE_EXPORT_SUPPORT(1 << 4) -#define FUSE_BIG_WRITES(1 << 5) /** * Release flags */ #define FUSE_RELEASE_FLUSH (1 << 0) -/** - * Getattr flags - */ -#define FUSE_GETATTR_FH(1 << 0) - -/** - * Lock flags - */ -#define FUSE_LK_FLOCK (1 << 0) - -/** - * WRITE flags - * - * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed - * FUSE_WRITE_LOCKOWNER: lock_owner field is valid - */ -#define FUSE_WRITE_CACHE (1 << 0) -#define FUSE_WRITE_LOCKOWNER (1 << 1) - -/** - * Read flags - */ -#define FUSE_READ_LOCKOWNER(1 << 1) - enum fuse_opcode { FUSE_LOOKUP= 1, FUSE_FORGET= 2, /* no reply */ @@ -221,8 +172,6 @@ enum fuse_opcode { /* The read buffer is required to be at least 8k, but may be much larger */ #define FUSE_MIN_READ_BUFFER 8192 -#define FUSE_COMPAT_ENTRY_OUT_SIZE 120 - struct fuse_entry_out { __u64 nodeid; /* Inode ID */ __u64 generation; /* Inode generation: nodeid:gen must @@ -238,14 +187,6 @@ struct fuse_forget_in { __u64 nlookup; }; -struct fuse_getattr_in { - __u32 getattr_flags; - __u32 dummy; - __u64 fh; -}; - -#define FUSE_COMPAT_ATTR_OUT_SIZE 96 - struct fuse_attr_out { __u64 attr_valid; /* Cache timeout for the attributes */ __u32 attr_valid_nsec; @@ -253,11 +194,6 @@ struct fuse_attr_out { struct fuse_attr attr; }; -struct fuse_mknod_in { - __u32 mode; - __u32 rdev; -}; - struct fuse_mkdir_in { __u32 mode; __u32 padding; @@ -276,7 +212,7 @@ struct fuse_setattr_in { __u32 padding; __u64 fh; __u64 size; - __u64 lock_owner; + __u64 unused1; __u64 atime; __u64 mtime; __u64 unused2; @@ -319,22 +255,14 @@ struct fuse_read_in { __u64 fh; __u64 offset; __u32 size; - __u32 read_flags; - __u64 lock_owner; - __u32 flags; __u32 padding; }; -#define FUSE_COMPAT_WRITE_IN_SIZE 24 - struct fuse_write_in { __u64 fh; __u64 offset; __u32 size; __
svn commit: r253620 - head/sys/kern
Author: jhb Date: Wed Jul 24 20:34:25 2013 New Revision: 253620 URL: http://svnweb.freebsd.org/changeset/base/253620 Log: Use VMFS_OPTIMAL_SPACE instead of VMFS_ALIGNED_SPACE in shm_map(). Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c == --- head/sys/kern/uipc_shm.cWed Jul 24 20:21:29 2013(r253619) +++ head/sys/kern/uipc_shm.cWed Jul 24 20:34:25 2013(r253620) @@ -779,7 +779,7 @@ shm_map(struct file *fp, size_t size, of offset = trunc_page(offset); size = round_page(size + ofs); rv = vm_map_find(kernel_map, obj, offset, &kva, size, - VMFS_ALIGNED_SPACE, VM_PROT_READ | VM_PROT_WRITE, + VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, 0); if (rv == KERN_SUCCESS) { rv = vm_map_wire(kernel_map, kva, kva + size, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253634 - head/sys/arm/conf
Author: rpaulo Date: Thu Jul 25 03:31:27 2013 New Revision: 253634 URL: http://svnweb.freebsd.org/changeset/base/253634 Log: Enable modules for the BeagleBone and for the Raspberry Pi. Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/BEAGLEBONE == --- head/sys/arm/conf/BEAGLEBONEThu Jul 25 02:48:01 2013 (r253633) +++ head/sys/arm/conf/BEAGLEBONEThu Jul 25 03:31:27 2013 (r253634) @@ -24,7 +24,6 @@ ident BEAGLEBONE include"../ti/am335x/std.beaglebone" -makeoptionsMODULES_OVERRIDE="" makeoptionsWITHOUT_MODULES="ahc" optionsHZ=100 @@ -82,7 +81,7 @@ devicemmc # mmc/sd bus device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -optionsROOTDEVNAME=\"ufs:mmcsd0s2\" +optionsROOTDEVNAME=\"ufs:mmcsd1s2\" # Console and misc device uart Modified: head/sys/arm/conf/RPI-B == --- head/sys/arm/conf/RPI-B Thu Jul 25 02:48:01 2013(r253633) +++ head/sys/arm/conf/RPI-B Thu Jul 25 03:31:27 2013(r253634) @@ -20,7 +20,6 @@ ident RPI-B include"../broadcom/bcm2835/std.rpi" -makeoptionsMODULES_OVERRIDE="" makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols optionsHZ=100 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253635 - head/sys/arm/conf
Author: rpaulo Date: Thu Jul 25 03:44:12 2013 New Revision: 253635 URL: http://svnweb.freebsd.org/changeset/base/253635 Log: Revert ROOTDEVNAME change from previous commit. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE == --- head/sys/arm/conf/BEAGLEBONEThu Jul 25 03:31:27 2013 (r253634) +++ head/sys/arm/conf/BEAGLEBONEThu Jul 25 03:44:12 2013 (r253635) @@ -81,7 +81,7 @@ devicemmc # mmc/sd bus device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -optionsROOTDEVNAME=\"ufs:mmcsd1s2\" +optionsROOTDEVNAME=\"ufs:mmcsd0s2\" # Console and misc device uart ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253636 - head/sys/vm
Author: kientzle Date: Thu Jul 25 03:48:37 2013 New Revision: 253636 URL: http://svnweb.freebsd.org/changeset/base/253636 Log: Clear entire map structure including locks so that the locks don't accidentally appear to have been already initialized. In particular, this fixes a consistent kernel crash on armv6 with: panic: lock "vm map (user)" 0xc09cc050 already initialized that appeared with r251709. PR: arm/180820 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c == --- head/sys/vm/vm_map.cThu Jul 25 03:44:12 2013(r253635) +++ head/sys/vm/vm_map.cThu Jul 25 03:48:37 2013(r253636) @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int fl vm_map_t map; map = (vm_map_t)mem; - map->nentries = 0; - map->size = 0; + memset(map, 0, sizeof(*map)); mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK); sx_init(&map->lock, "vm map (user)"); return (0); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253637 - in head: etc/mtree lib/libusb
Author: rpaulo Date: Thu Jul 25 03:54:08 2013 New Revision: 253637 URL: http://svnweb.freebsd.org/changeset/base/253637 Log: Add pkgconf files for libusb. Reviewed by: hselasky Added: head/lib/libusb/libusb-0.1.pc (contents, props changed) head/lib/libusb/libusb-1.0.pc (contents, props changed) head/lib/libusb/libusb-2.0.pc (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/lib/libusb/Makefile Modified: head/etc/mtree/BSD.usr.dist == --- head/etc/mtree/BSD.usr.dist Thu Jul 25 03:48:37 2013(r253636) +++ head/etc/mtree/BSD.usr.dist Thu Jul 25 03:54:08 2013(r253637) @@ -38,6 +38,8 @@ .. lint .. +pkgconfig +.. .. libexec bsdinstall Modified: head/lib/libusb/Makefile == --- head/lib/libusb/MakefileThu Jul 25 03:48:37 2013(r253636) +++ head/lib/libusb/MakefileThu Jul 25 03:54:08 2013(r253637) @@ -38,6 +38,14 @@ SRCS+= libusb10_io.c CFLAGS+= -DCOMPAT_32BIT .endif +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-0.1.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-1.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-2.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + # # Cross platform support # Added: head/lib/libusb/libusb-0.1.pc == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb-0.1.pc Thu Jul 25 03:54:08 2013 (r253637) @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-0.1 +Description: Library that abstracts ways to access USB devices (v0.1) +Version: 0.1.0 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} Added: head/lib/libusb/libusb-1.0.pc == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb-1.0.pc Thu Jul 25 03:54:08 2013 (r253637) @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-1.0 +Description: Library that abstracts ways to access USB devices (v1.0) +Version: 1.0.9 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} Added: head/lib/libusb/libusb-2.0.pc == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb-2.0.pc Thu Jul 25 03:54:08 2013 (r253637) @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-2.0 +Description: Library that abstracts ways to access USB devices (v2.0) +Version: 2.0.0 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253638 - head/sys/sys
Author: rpaulo Date: Thu Jul 25 03:55:50 2013 New Revision: 253638 URL: http://svnweb.freebsd.org/changeset/base/253638 Log: Bump __FreeBSD_version for the addition of libusb's pkgconf files. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hThu Jul 25 03:54:08 2013(r253637) +++ head/sys/sys/param.hThu Jul 25 03:55:50 2013(r253638) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 139 /* Master, propagated to newvers */ +#define __FreeBSD_version 140 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253637 - in head: etc/mtree lib/libusb
On 24 Jul 2013, at 20:54, Rui Paulo wrote: > Author: rpaulo > Date: Thu Jul 25 03:54:08 2013 > New Revision: 253637 > URL: http://svnweb.freebsd.org/changeset/base/253637 > > Log: > Add pkgconf files for libusb. > > Reviewed by: hselasky This breaks libgphoto2, but I filed a PR with a proposed fix: http://www.freebsd.org/cgi/query-pr.cgi?pr=180825 -- Rui Paulo ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253639 - head/sys/net80211
Author: rpaulo Date: Thu Jul 25 06:23:26 2013 New Revision: 253639 URL: http://svnweb.freebsd.org/changeset/base/253639 Log: Add ieee80211_add_{qos,wpa,rsn}() functions since they are needed by an OpenBSD driver that is being ported to FreeBSD. Reviewed by: adrian Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211.h == --- head/sys/net80211/ieee80211.h Thu Jul 25 03:55:50 2013 (r253638) +++ head/sys/net80211/ieee80211.h Thu Jul 25 06:23:26 2013 (r253639) @@ -711,6 +711,7 @@ enum { IEEE80211_ELEMID_IBSSDFS= 41, IEEE80211_ELEMID_ERP= 42, IEEE80211_ELEMID_HTCAP = 45, + IEEE80211_ELEMID_QOS= 46, IEEE80211_ELEMID_RSN= 48, IEEE80211_ELEMID_XRATES = 50, IEEE80211_ELEMID_HTINFO = 61, Modified: head/sys/net80211/ieee80211_output.c == --- head/sys/net80211/ieee80211_output.cThu Jul 25 03:55:50 2013 (r253638) +++ head/sys/net80211/ieee80211_output.cThu Jul 25 06:23:26 2013 (r253639) @@ -1883,6 +1883,40 @@ ieee80211_add_countryie(uint8_t *frm, st return add_appie(frm, ic->ic_countryie); } +uint8_t * +ieee80211_add_wpa(uint8_t *frm, const struct ieee80211vap *vap) +{ + if (vap->iv_flags & IEEE80211_F_WPA1 && vap->iv_wpa_ie != NULL) + return (add_ie(frm, vap->iv_wpa_ie)); + else { + /* XXX else complain? */ + return (frm); + } +} + +uint8_t * +ieee80211_add_rsn(uint8_t *frm, const struct ieee80211vap *vap) +{ + if (vap->iv_flags & IEEE80211_F_WPA2 && vap->iv_rsn_ie != NULL) + return (add_ie(frm, vap->iv_rsn_ie)); + else { + /* XXX else complain? */ + return (frm); + } +} + +uint8_t * +ieee80211_add_qos(uint8_t *frm, const struct ieee80211_node *ni) +{ + if (ni->ni_flags & IEEE80211_NODE_QOS) { + *frm++ = IEEE80211_ELEMID_QOS; + *frm++ = 1; + *frm++ = 0; + } + + return (frm); +} + /* * Send a probe request frame with the specified ssid * and any optional information element data. @@ -1951,17 +1985,9 @@ ieee80211_send_probereq(struct ieee80211 frm = ieee80211_add_ssid(frm, ssid, ssidlen); rs = ieee80211_get_suprates(ic, ic->ic_curchan); frm = ieee80211_add_rates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); frm = ieee80211_add_xrates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_appie_probereq != NULL) frm = add_appie(frm, vap->iv_appie_probereq); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); @@ -2227,11 +2253,7 @@ ieee80211_send_mgmt(struct ieee80211_nod frm = ieee80211_add_ssid(frm, ni->ni_essid, ni->ni_esslen); frm = ieee80211_add_rates(frm, &ni->ni_rates); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); frm = ieee80211_add_xrates(frm, &ni->ni_rates); if (capinfo & IEEE80211_CAPINFO_SPECTRUM_MGMT) { frm = ieee80211_add_powercapability(frm, @@ -2242,11 +2264,7 @@ ieee80211_send_mgmt(struct ieee80211_nod ni->ni_ies.htcap_ie != NULL && ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_HTCAP) frm = ieee80211_add_htcap(frm, ni); - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain */ - } + frm = ieee80211_add_wpa(frm, vap); if ((ic->ic_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) frm = ieee80211_add_wme_info(frm, &ic->ic_wme); @@ -2513,11 +2531,7 @@ ieee80211_alloc_proberesp(struct ieee802 if (IEEE80211_IS_CHAN_ANYG(bss->ni_chan)) frm = ieee80211_add_erp(frm, ic); frm = ieee80211_add_xrates(frm, rs); - if (vap-