svn commit: r220091 - head/tools/tools/nanobsd
Author: mr Date: Mon Mar 28 07:00:41 2011 New Revision: 220091 URL: http://svn.freebsd.org/changeset/base/220091 Log: Use ${NANO_WORLDDIR}/var/empty as copy source since it has no schg flag set. Copying over /var/empty's schg flag had unpleasant side effects (schg flag on /etc and /cfg) during nanobsd boot before. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh == --- head/tools/tools/nanobsd/nanobsd.sh Mon Mar 28 06:35:17 2011 (r220090) +++ head/tools/tools/nanobsd/nanobsd.sh Mon Mar 28 07:00:41 2011 (r220091) @@ -413,8 +413,8 @@ populate_slice ( ) ( dir=$2 mnt=$3 lbl=$4 - test -z $2 && dir=/var/empty - test -d $dir || dir=/var/empty + test -z $2 && dir=${NANO_WORLDDIR}/var/empty + test -d $dir || dir=${NANO_WORLDDIR}/var/empty echo "Creating ${dev} with ${dir} (mounting on ${mnt})" newfs_part $dev $mnt $lbl cd ${dir} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220092 - stable/8/sys/compat/freebsd32
Author: kib Date: Mon Mar 28 08:22:13 2011 New Revision: 220092 URL: http://svn.freebsd.org/changeset/base/220092 Log: MFC r219986: Fix file leakage in the freebsd32_ioctl routines. Modified: stable/8/sys/compat/freebsd32/freebsd32_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_ioctl.c == --- stable/8/sys/compat/freebsd32/freebsd32_ioctl.c Mon Mar 28 07:00:41 2011(r220091) +++ stable/8/sys/compat/freebsd32/freebsd32_ioctl.c Mon Mar 28 08:22:13 2011(r220092) @@ -70,7 +70,6 @@ freebsd32_ioctl_md(struct thread *td, st panic("%s: where is my ioctl data??", __func__); if (uap->com & IOC_IN) { if ((error = copyin(uap->data, &md32, sizeof(md32 { - fdrop(fp, td); return (error); } CP(md32, mdv, md_version); @@ -121,7 +120,6 @@ freebsd32_ioctl_md(struct thread *td, st CP(mdv, md32, md_fwsectors); error = copyout(&md32, uap->data, sizeof(md32)); } - fdrop(fp, td); return error; } @@ -144,7 +142,6 @@ freebsd32_ioctl_ioc_toc_header(struct th CP(toch32, toch, ending_track); error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&toch, td->td_ucred, td); - fdrop(fp, td); return (error); } @@ -175,7 +172,6 @@ freebsd32_ioctl_ioc_read_toc(struct thre PTROUT_CP(toce, toce32, data); error = copyout(&toce32, uap->data, sizeof(toce32)); } - fdrop(fp, td); return error; } @@ -192,7 +188,6 @@ freebsd32_ioctl_fiodgname(struct thread CP(fgn32, fgn, len); PTRIN_CP(fgn32, fgn, buf); error = fo_ioctl(fp, FIODGNAME, (caddr_t)&fgn, td->td_ucred, td); - fdrop(fp, td); return (error); } @@ -219,16 +214,20 @@ freebsd32_ioctl(struct thread *td, struc case MDIOCDETACH_32:/* FALLTHROUGH */ case MDIOCQUERY_32: /* FALLTHROUGH */ case MDIOCLIST_32: - return freebsd32_ioctl_md(td, uap, fp); + error = freebsd32_ioctl_md(td, uap, fp); + break; case CDIOREADTOCENTRYS_32: - return freebsd32_ioctl_ioc_read_toc(td, uap, fp); + error = freebsd32_ioctl_ioc_read_toc(td, uap, fp); + break; case CDIOREADTOCHEADER_32: - return freebsd32_ioctl_ioc_toc_header(td, uap, fp); + error = freebsd32_ioctl_ioc_toc_header(td, uap, fp); + break; case FIODGNAME_32: - return freebsd32_ioctl_fiodgname(td, uap, fp); + error = freebsd32_ioctl_fiodgname(td, uap, fp); + break; default: fdrop(fp, td); @@ -237,4 +236,7 @@ freebsd32_ioctl(struct thread *td, struc PTRIN_CP(*uap, ap, data); return ioctl(td, &ap); } + + fdrop(fp, td); + return error; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220093 - stable/8/sys/compat/freebsd32
Author: kib Date: Mon Mar 28 08:23:45 2011 New Revision: 220093 URL: http://svn.freebsd.org/changeset/base/220093 Log: MFC r219987: Remove unneccessary panics. Modified: stable/8/sys/compat/freebsd32/freebsd32_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_ioctl.c == --- stable/8/sys/compat/freebsd32/freebsd32_ioctl.c Mon Mar 28 08:22:13 2011(r220092) +++ stable/8/sys/compat/freebsd32/freebsd32_ioctl.c Mon Mar 28 08:23:45 2011(r220093) @@ -66,8 +66,6 @@ freebsd32_ioctl_md(struct thread *td, st u_long com = 0; int error; - if (uap->data == NULL) - panic("%s: where is my ioctl data??", __func__); if (uap->com & IOC_IN) { if ((error = copyin(uap->data, &md32, sizeof(md32 { return (error); @@ -132,9 +130,6 @@ freebsd32_ioctl_ioc_toc_header(struct th struct ioc_toc_header32 toch32; int error; - if (uap->data == NULL) - panic("%s: where is my ioctl data??", __func__); - if ((error = copyin(uap->data, &toch32, sizeof(toch32 return (error); CP(toch32, toch, len); @@ -154,9 +149,6 @@ freebsd32_ioctl_ioc_read_toc(struct thre struct ioc_read_toc_entry32 toce32; int error; - if (uap->data == NULL) - panic("%s: where is my ioctl data??", __func__); - if ((error = copyin(uap->data, &toce32, sizeof(toce32 return (error); CP(toce32, toce, address_format); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220094 - head/usr.bin/calendar/calendars
Author: martymac (ports committer) Date: Mon Mar 28 08:37:48 2011 New Revision: 220094 URL: http://svn.freebsd.org/changeset/base/220094 Log: Add myself Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdMon Mar 28 08:23:45 2011(r220093) +++ head/usr.bin/calendar/calendars/calendar.freebsdMon Mar 28 08:37:48 2011(r220094) @@ -320,6 +320,7 @@ 12/03 Diane Bruce born in Ottawa, Ontario, Canada, 1952 12/05 Ivan Voras born in Slavonski Brod, Croatia, 1981 12/06 Stefan Farfeleder born in Wien, Austria, 1980 +12/11 Ganael Laplanche born in Reims, France, 1980 12/15 James FitzGibbon born in Amersham, Buckinghamshire, United Kingdom, 1974 12/15 Timur I. Bakeyev born in Kazan, Republic of Tatarstan, USSR, 1974 12/18 Chris Timmons born in Ellensburg, Washington, United States, 1964 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220095 - head/share/misc
Author: martymac (ports committer) Date: Mon Mar 28 09:05:43 2011 New Revision: 220095 URL: http://svn.freebsd.org/changeset/base/220095 Log: Add myself to committers-ports.dot Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot == --- head/share/misc/committers-ports.dotMon Mar 28 08:37:48 2011 (r220094) +++ head/share/misc/committers-ports.dotMon Mar 28 09:05:43 2011 (r220095) @@ -127,6 +127,7 @@ makc [label="Max Brazhnikov\nmakc@FreeBS mandree [label="Matthias Andree\nmand...@freebsd.org\n2009/11/18"] marcus [label="Joe Marcus Clarke\nmar...@freebsd.org\n2002/04/05"] markus [label="Markus Brueffer\nmar...@freebsd.org\n2004/02/21"] +martymac [label="Ganael Laplanche\nmarty...@freebsd.org\n2010/09/24"] mat [label="Mathieu Arnold\n...@freebsd.org\n2003/08/15"] mezz [label="Jeremy Messenger\nm...@freebsd.org\n2004/04/30"] miwi [label="Martin Wilke\nm...@freebsd.org\n2006/06/04"] ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220096 - head/sys/mips/atheros
Author: adrian Date: Mon Mar 28 09:10:59 2011 New Revision: 220096 URL: http://svn.freebsd.org/changeset/base/220096 Log: The previous commit didn't completely rename this to what it should be. Modified: head/sys/mips/atheros/ar71xx_machdep.c Modified: head/sys/mips/atheros/ar71xx_machdep.c == --- head/sys/mips/atheros/ar71xx_machdep.c Mon Mar 28 09:05:43 2011 (r220095) +++ head/sys/mips/atheros/ar71xx_machdep.c Mon Mar 28 09:10:59 2011 (r220096) @@ -217,7 +217,7 @@ platform_start(__register_t a0 __unused, * but in fact there's 32mb. */ #ifdefined(AR71XX_REALMEM) - realmem = btoc(MIPS_REALMEM); + realmem = btoc(AR71XX_REALMEM); #endif /* phys_avail regions are in bytes */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220097 - head/sys/dev/mvs
Author: mav Date: Mon Mar 28 11:08:58 2011 New Revision: 220097 URL: http://svn.freebsd.org/changeset/base/220097 Log: Update mvs(4) driver to work over FDT's simplebus(4) bus. Modified: head/sys/dev/mvs/mvs_soc.c Modified: head/sys/dev/mvs/mvs_soc.c == --- head/sys/dev/mvs/mvs_soc.c Mon Mar 28 09:10:59 2011(r220096) +++ head/sys/dev/mvs/mvs_soc.c Mon Mar 28 11:08:58 2011(r220097) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "mvs.h" /* local prototypes */ @@ -73,6 +75,9 @@ mvs_probe(device_t dev) int i; uint32_t devid, revid; + if (!ofw_bus_is_compatible(dev, "mrvl,sata")) + return (ENXIO); + soc_id(&devid, &revid); for (i = 0; mvs_ids[i].id != 0; i++) { if (mvs_ids[i].id == devid && @@ -440,10 +445,10 @@ static device_method_t mvs_methods[] = { { 0, 0 } }; static driver_t mvs_driver = { -"sata", +"mvs", mvs_methods, sizeof(struct mvs_controller) }; -DRIVER_MODULE(sata, mbus, mvs_driver, mvs_devclass, 0, 0); -MODULE_VERSION(sata, 1); - +DRIVER_MODULE(mvs, simplebus, mvs_driver, mvs_devclass, 0, 0); +MODULE_VERSION(mvs, 1); +MODULE_DEPEND(mvs, cam, 1, 1, 1); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220098 - head/sys/dev/ath
Author: adrian Date: Mon Mar 28 11:48:49 2011 New Revision: 220098 URL: http://svn.freebsd.org/changeset/base/220098 Log: Add in HT protection but disable it by default. I'll clear how it's supposed to work with Bernhard and then look at enabling this in the correct situations. But this -does- enable HT RTS protection (using the appropriate legacy rates) if this bit of code is enabled. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c == --- head/sys/dev/ath/if_ath_tx.cMon Mar 28 11:08:58 2011 (r220097) +++ head/sys/dev/ath/if_ath_tx.cMon Mar 28 11:48:49 2011 (r220098) @@ -702,6 +702,24 @@ ath_tx_start(struct ath_softc *sc, struc sc->sc_stats.ast_tx_protect++; } +#if 0 + /* +* If 11n protection is enabled and it's a HT frame, +* enable RTS. +* +* XXX ic_htprotmode or ic_curhtprotmode? +* XXX should it_htprotmode only matter if ic_curhtprotmode +* XXX indicates it's not a HT pure environment? +*/ + if ((ic->ic_htprotmode == IEEE80211_PROT_RTSCTS) && + rt->info[rix].phy == IEEE80211_T_HT && + (flags & HAL_TXDESC_NOACK) == 0) { + cix = rt->info[sc->sc_protrix].controlRate; + flags |= HAL_TXDESC_RTSENA; + sc->sc_stats.ast_tx_htprotect++; + } +#endif + /* * Calculate duration. This logically belongs in the 802.11 * layer but it lacks sufficient information to calculate it. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220099 - head/sys/ufs/ffs
Author: kib Date: Mon Mar 28 12:39:48 2011 New Revision: 220099 URL: http://svn.freebsd.org/changeset/base/220099 Log: Fix the softdep_request_cleanup() function definition for !SOFTUPDATES case. Submitted by: Aleksandr Rybalko Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Mon Mar 28 11:48:49 2011 (r220098) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Mar 28 12:39:48 2011 (r220099) @@ -514,9 +514,10 @@ softdep_releasefile(ip) } int -softdep_request_cleanup(fs, vp) +softdep_request_cleanup(fs, vp, resource) struct fs *fs; struct vnode *vp; + int resource; { return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220100 - in head/sys: dev/ksyms kern sys
Author: kib Date: Mon Mar 28 12:48:33 2011 New Revision: 220100 URL: http://svn.freebsd.org/changeset/base/220100 Log: Promote ksyms_map() and ksyms_unmap() to general facility copyout_map() and copyout_unmap() interfaces. Submitted by: John Wehle , nox MFC after:2 weeks Modified: head/sys/dev/ksyms/ksyms.c head/sys/kern/subr_uio.c head/sys/sys/uio.h Modified: head/sys/dev/ksyms/ksyms.c == --- head/sys/dev/ksyms/ksyms.c Mon Mar 28 12:39:48 2011(r220099) +++ head/sys/dev/ksyms/ksyms.c Mon Mar 28 12:48:33 2011(r220100) @@ -360,53 +360,6 @@ ksyms_snapshot(struct tsizes *ts, vm_off return (error); } -/* - * Map some anonymous memory in user space of size sz, rounded up to the page - * boundary. - */ -static int -ksyms_map(struct thread *td, vm_offset_t *addr, size_t sz) -{ - struct vmspace *vms = td->td_proc->p_vmspace; - int error; - vm_size_t size; - - - /* -* Map somewhere after heap in process memory. -*/ - PROC_LOCK(td->td_proc); - *addr = round_page((vm_offset_t)vms->vm_daddr + - lim_max(td->td_proc, RLIMIT_DATA)); - PROC_UNLOCK(td->td_proc); - - /* round size up to page boundry */ - size = (vm_size_t) round_page(sz); - - error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, - VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); - - return (error); -} - -/* - * Unmap memory in user space. - */ -static int -ksyms_unmap(struct thread *td, vm_offset_t addr, size_t sz) -{ - vm_map_t map; - vm_size_t size; - - map = &td->td_proc->p_vmspace->vm_map; - size = (vm_size_t) round_page(sz); - - if (!vm_map_remove(map, addr, addr + size)) - return (EINVAL); - - return (0); -} - static void ksyms_cdevpriv_dtr(void *data) { @@ -475,7 +428,7 @@ ksyms_open(struct cdev *dev, int flags, total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + ts.ts_strsz; - error = ksyms_map(td, &(sc->sc_uaddr), + error = copyout_map(td, &(sc->sc_uaddr), (vm_size_t) total_elf_sz); if (error) break; @@ -488,7 +441,7 @@ ksyms_open(struct cdev *dev, int flags, } /* Snapshot failed, unmap the memory and try again */ - (void) ksyms_unmap(td, sc->sc_uaddr, sc->sc_usize); + (void) copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); } failed: @@ -624,7 +577,7 @@ ksyms_close(struct cdev *dev, int flags return (error); /* Unmap the buffer from the process address space. */ - error = ksyms_unmap(td, sc->sc_uaddr, sc->sc_usize); + error = copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); devfs_clear_cdevpriv(); Modified: head/sys/kern/subr_uio.c == --- head/sys/kern/subr_uio.cMon Mar 28 12:39:48 2011(r220099) +++ head/sys/kern/subr_uio.cMon Mar 28 12:48:33 2011(r220100) @@ -44,13 +44,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include #include +#include #include #include #ifdef ZERO_COPY_SOCKETS @@ -457,3 +460,49 @@ cloneuio(struct uio *uiop) bcopy(uiop->uio_iov, uio->uio_iov, iovlen); return (uio); } + +/* + * Map some anonymous memory in user space of size sz, rounded up to the page + * boundary. + */ +int +copyout_map(struct thread *td, vm_offset_t *addr, size_t sz) +{ + struct vmspace *vms = td->td_proc->p_vmspace; + int error; + vm_size_t size; + + /* +* Map somewhere after heap in process memory. +*/ + PROC_LOCK(td->td_proc); + *addr = round_page((vm_offset_t)vms->vm_daddr + + lim_max(td->td_proc, RLIMIT_DATA)); + PROC_UNLOCK(td->td_proc); + + /* round size up to page boundry */ + size = (vm_size_t) round_page(sz); + + error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, + VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); + + return (error); +} + +/* + * Unmap memory in user space. + */ +int +copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz) +{ + vm_map_t map; + vm_size_t size; + + map = &td->td_proc->p_vmspace->vm_map; + size = (vm_size_t) round_page(sz); + + if (!vm_map_remove(map, addr, addr + size)) + return (EINVAL); + + return (0); +} Modified: head/sys/sys/uio.h == --- head/sys/sys/uio.h Mon Mar 28 12:39:48 2011(r220099) +++
svn commit: r220101 - head/sys/kern
Author: kib Date: Mon Mar 28 13:21:26 2011 New Revision: 220101 URL: http://svn.freebsd.org/changeset/base/220101 Log: Handle zero length in copyout_unmap(). Submitted by: John Wehle MFC after:2 weeks Modified: head/sys/kern/subr_uio.c Modified: head/sys/kern/subr_uio.c == --- head/sys/kern/subr_uio.cMon Mar 28 12:48:33 2011(r220100) +++ head/sys/kern/subr_uio.cMon Mar 28 13:21:26 2011(r220101) @@ -498,6 +498,9 @@ copyout_unmap(struct thread *td, vm_offs vm_map_t map; vm_size_t size; + if (sz == 0) + return (0); + map = &td->td_proc->p_vmspace->vm_map; size = (vm_size_t) round_page(sz); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220102 - head/sys/kern
Author: kib Date: Mon Mar 28 13:28:23 2011 New Revision: 220102 URL: http://svn.freebsd.org/changeset/base/220102 Log: Trim white spaces, adjust style. MFC after:2 weeks Modified: head/sys/kern/subr_uio.c Modified: head/sys/kern/subr_uio.c == --- head/sys/kern/subr_uio.cMon Mar 28 13:21:26 2011(r220101) +++ head/sys/kern/subr_uio.cMon Mar 28 13:28:23 2011(r220102) @@ -468,24 +468,26 @@ cloneuio(struct uio *uiop) int copyout_map(struct thread *td, vm_offset_t *addr, size_t sz) { - struct vmspace *vms = td->td_proc->p_vmspace; + struct vmspace *vms; int error; vm_size_t size; - - /* + + vms = td->td_proc->p_vmspace; + + /* * Map somewhere after heap in process memory. */ PROC_LOCK(td->td_proc); - *addr = round_page((vm_offset_t)vms->vm_daddr + + *addr = round_page((vm_offset_t)vms->vm_daddr + lim_max(td->td_proc, RLIMIT_DATA)); PROC_UNLOCK(td->td_proc); /* round size up to page boundry */ - size = (vm_size_t) round_page(sz); - - error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, + size = (vm_size_t)round_page(sz); + + error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); - + return (error); } @@ -497,12 +499,12 @@ copyout_unmap(struct thread *td, vm_offs { vm_map_t map; vm_size_t size; - + if (sz == 0) return (0); map = &td->td_proc->p_vmspace->vm_map; - size = (vm_size_t) round_page(sz); + size = (vm_size_t)round_page(sz); if (!vm_map_remove(map, addr, addr + size)) return (EINVAL); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220103 - head/sys/dev/fxp
Author: yongari Date: Mon Mar 28 16:58:48 2011 New Revision: 220103 URL: http://svn.freebsd.org/changeset/base/220103 Log: Normally fxp(4) does not receive bad frames but promiscuous mode makes controller to receive bad frames and i82557 will also receive bad frames since fxp(4) have to receive VLAN oversized frames. If fxp(4) encounter DMA overrun error, the received frame size would be 0 so the actual frame size after checksum field extraction the length would be negative(-2). Due to signed/unsigned comparison used in driver, frame length check did not work for DMA overrun frames. Correct this by casting it to int. While I'm here explicitly check DMA overrun error and discard the frame regardless of result of received frame length check. Reported by: n_hibma Tested by:n_hibma MFC after:1 week Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c == --- head/sys/dev/fxp/if_fxp.c Mon Mar 28 13:28:23 2011(r220102) +++ head/sys/dev/fxp/if_fxp.c Mon Mar 28 16:58:48 2011(r220103) @@ -1941,11 +1941,11 @@ fxp_intr_body(struct fxp_softc *sc, stru /* Adjust for appended checksum bytes. */ total_len -= 2; } - if (total_len < sizeof(struct ether_header) || + if (total_len < (int)sizeof(struct ether_header) || total_len > (MCLBYTES - RFA_ALIGNMENT_FUDGE - sc->rfa_size) || status & (FXP_RFA_STATUS_CRC | - FXP_RFA_STATUS_ALIGN)) { + FXP_RFA_STATUS_ALIGN | FXP_RFA_STATUS_OVERRUN)) { m_freem(m); fxp_add_rfabuf(sc, rxp); continue; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220104 - in stable/8: etc etc/mail etc/rc.d sbin/hastctl sbin/hastd
Author: trociny Date: Mon Mar 28 17:41:10 2011 New Revision: 220104 URL: http://svn.freebsd.org/changeset/base/220104 Log: MFC r217729, r217730, r217731, r217732, r217737, r217784, r217958, r217961, r217962, r217964, r217965, r217966, r217967, r217969, r218040, r218041, r218042, r218043, r218044, r218045, r218048, r218049, r218119, r218132, r218138, r218139, r218147, r218148, r218158, r218185, r218191, r218192, r218193, r218194, r218201, r218214, r218215, r218217, r218218, r218370, r218373, r218374, r218375, r218376, r218464, r218465, r218474, r219082: r217729 (pjd): - On primary worker reload, update hr_exec field. - Update comment. r217730 (pjd): Use int16 for error. r217731 (pjd): Use more consistent function name with the others (pjdlogv_prefix_set() instead of pjdlog_prefix_setv()). r217732 (pjd): Add nv_assert() which allows to assert that the given name exists. r217737 (pjd): Add missing logs. r217784 (pjd): Don't open configuration file from worker process. Handle SIGHUP in the master process only and pass changes to the worker processes over control socket. This removes access to global namespace in preparation for capsicum sandboxing. r217958 (pjd): Remove __dead2 from pjdlog_verify() prototype, it does return sometimes. r217961 (pjd): - Remove obvious NOTREACHED comment after abort() call. - Remove redundant newline at the end of the file. r217962 (pjd): Add LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately open so there are no surprises once we start chrooting or using capsicum. r217964 (pjd): Use pjd copyright for 2011 work. r217965 (pjd): Add functions to initialize/finalize pjdlog. This allows to open/close log file at will. r217966 (pjd): Extend pjdlog_verify() to support the following additional macros: PJDLOG_RVERIFY() - always check expression and on false log the given message and exit. PJDLOG_RASSERT() - check expression when NDEBUG is not defined and on false log given message and exit. PJDLOG_ABORT() - log the given message and exit. r217967 (pjd): Close the control socket before exiting, so it will be unlinked. r217969 (pjd): Remember created control connection so on fork(2) we can close it in child. r218040 (pjd): Initialize all global variables on pjdlog_init(). r218041 (pjd): Add function to close all unneeded descriptors after fork(2). r218042 (pjd): Add comments to places where we treat errors as ciritical, but it is possible to handle them more gracefully. r218043 (pjd): Close all unneeded descriptors after fork(2). r218044 (pjd): Add function to assert that the only descriptors we have open are the ones we expect to be open. Also assert that they point at expected type. Because openlog(3) API is unable to tell us descriptor number it is using, we have to close syslog socket, remember assert message in local buffer and if we fail on assertion, reopen syslog socket and log the message. r218045 (pjd): Use newly added descriptors_assert() function to ensure only expected descriptors are open. r218046 (pjd), r218047 (pjd), r218119 (maxim): Add 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl) to drop privileges. r218048 (pjd): Implement function that drops privileges by: - chrooting to /var/empty (user hast home directory), - setting groups to 'hast' (user hast primary group), - setting real group id, effective group id and saved group id to 'hast', - setting real user id, effective user id and saved user id to 'hast'. At the end verify that those operations where successfull. r218049 (pjd): Drop privileges in worker processes. Accepting connections and handshaking in secondary is still done before dropping privileges. It should be implemented by only accepting connections in privileged main process and passing connection descriptors to the worker, but is not implemented yet. r218132 (pjd): Rename pjdlog_verify() to pjdlog_abort() as it better describes what the the function does and mark it with __dead2. r218138 (pjd): - Use pjdlog for assertions and aborts as this will log assert/abort message to syslog if we run in background. - Asserts in proto.c that method we want to call is implemented and remove dummy methods from protocols implementation that are only there to abort the program with nice message. r218139 (pjd): Implement two new functions for sending descriptor and receving descriptor over UNIX domain sockets and socket pairs. This is in preparation for capsicum. r218147 (pjd), r218148 (pjd): Fix build on ia64. r218158 (pjd): Do not set socket send and receive buffer. It will be auto-tuned. Confirmed by: rwatson r2
svn commit: r220105 - head/sys/netinet
Author: weongyo Date: Mon Mar 28 19:03:56 2011 New Revision: 220105 URL: http://svn.freebsd.org/changeset/base/220105 Log: Covers values if (BYTES_THIS_ACK(tp, th) / tp->t_maxseg) value is from 2.0 to 3.0. Reviewed by: lstewart Modified: head/sys/netinet/tcp_sack.c Modified: head/sys/netinet/tcp_sack.c == --- head/sys/netinet/tcp_sack.c Mon Mar 28 17:41:10 2011(r220104) +++ head/sys/netinet/tcp_sack.c Mon Mar 28 19:03:56 2011(r220105) @@ -577,7 +577,7 @@ tcp_sack_partialack(struct tcpcb *tp, st tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; /* Send one or 2 segments based on how much new data was acked. */ - if ((BYTES_THIS_ACK(tp, th) / tp->t_maxseg) > 2) + if ((BYTES_THIS_ACK(tp, th) / tp->t_maxseg) >= 2) num_segs = 2; tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit + (tp->snd_nxt - tp->sack_newdata) + num_segs * tp->t_maxseg); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220106 - head/sys/dev/dc
Author: yongari Date: Mon Mar 28 19:08:53 2011 New Revision: 220106 URL: http://svn.freebsd.org/changeset/base/220106 Log: Revise r220046 by introducing dc_netcfg_wait() which waits the end of active DMA cycle. dc_setcfg() also has to wait until the DMA engine is stopped so using a common function to handle the job is better than duplicating the code. No objection from:marius Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c == --- head/sys/dev/dc/if_dc.c Mon Mar 28 19:03:56 2011(r220105) +++ head/sys/dev/dc/if_dc.c Mon Mar 28 19:08:53 2011(r220106) @@ -279,6 +279,7 @@ static void dc_miibus_statchg(device_t); static void dc_miibus_mediainit(device_t); static void dc_setcfg(struct dc_softc *, int); +static void dc_netcfg_wait(struct dc_softc *); static uint32_t dc_mchash_le(struct dc_softc *, const uint8_t *); static uint32_t dc_mchash_be(const uint8_t *); static void dc_setfilt_21143(struct dc_softc *); @@ -1370,6 +1371,32 @@ dc_setfilt(struct dc_softc *sc) dc_setfilt_xircom(sc); } +static void +dc_netcfg_wait(struct dc_softc *sc) +{ + uint32_t isr; + int i; + + for (i = 0; i < DC_TIMEOUT; i++) { + isr = CSR_READ_4(sc, DC_ISR); + if (isr & DC_ISR_TX_IDLE && + ((isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED || + (isr & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT)) + break; + DELAY(10); + } + if (i == DC_TIMEOUT) { + if (!(isr & DC_ISR_TX_IDLE) && !DC_IS_ASIX(sc)) + device_printf(sc->dc_dev, + "%s: failed to force tx to idle state\n", __func__); + if (!((isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED || + (isr & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT) && + !DC_HAS_BROKEN_RXSTATE(sc)) + device_printf(sc->dc_dev, + "%s: failed to force rx to idle state\n", __func__); + } +} + /* * In order to fiddle with the 'full-duplex' and '100Mbps' bits in * the netconfig register, we first have to put the transmit and/or @@ -1378,8 +1405,7 @@ dc_setfilt(struct dc_softc *sc) static void dc_setcfg(struct dc_softc *sc, int media) { - int i, restart = 0, watchdogreg; - uint32_t isr; + int restart = 0, watchdogreg; if (IFM_SUBTYPE(media) == IFM_NONE) return; @@ -1387,28 +1413,7 @@ dc_setcfg(struct dc_softc *sc, int media if (CSR_READ_4(sc, DC_NETCFG) & (DC_NETCFG_TX_ON | DC_NETCFG_RX_ON)) { restart = 1; DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_TX_ON | DC_NETCFG_RX_ON)); - - for (i = 0; i < DC_TIMEOUT; i++) { - isr = CSR_READ_4(sc, DC_ISR); - if (isr & DC_ISR_TX_IDLE && - ((isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED || - (isr & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT)) - break; - DELAY(10); - } - - if (i == DC_TIMEOUT) { - if (!(isr & DC_ISR_TX_IDLE) && !DC_IS_ASIX(sc)) - device_printf(sc->dc_dev, - "%s: failed to force tx to idle state\n", - __func__); - if (!((isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED || - (isr & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT) && - !DC_HAS_BROKEN_RXSTATE(sc)) - device_printf(sc->dc_dev, - "%s: failed to force rx to idle state\n", - __func__); - } + dc_netcfg_wait(sc); } if (IFM_SUBTYPE(media) == IFM_100_TX) { @@ -3917,7 +3922,7 @@ dc_stop(struct dc_softc *sc) struct dc_list_data *ld; struct dc_chain_data *cd; int i; - uint32_t ctl, isr; + uint32_t ctl, netcfg; DC_LOCK_ASSERT(sc); @@ -3928,38 +3933,21 @@ dc_stop(struct dc_softc *sc) callout_stop(&sc->dc_stat_ch); callout_stop(&sc->dc_wdog_ch); sc->dc_wdog_timer = 0; + sc->dc_link = 0; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_RX_ON | DC_NETCFG_TX_ON)); - - for (i = 0; i < DC_TIMEOUT; i++) { - isr = CSR_READ_4(sc, DC_ISR); - if ((isr & DC_ISR_TX_IDLE || - (isr & DC_ISR_TX_STATE) == DC_TXSTATE_RESET) && - (isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED) - break; - DELAY(10); - } - - if (i == DC_TIMEOUT) { - if (!((isr & DC_ISR_TX_IDLE) |
svn commit: r220107 - in stable/8/etc: periodic/daily periodic/security periodic/weekly rc.d
Author: dougb Date: Mon Mar 28 19:22:55 2011 New Revision: 220107 URL: http://svn.freebsd.org/changeset/base/220107 Log: MFC r219587, r220017, r220048 Adjust svn:executable properties Modified: Directory Properties: stable/8/etc/ (props changed) stable/8/etc/periodic/daily/404.status-zfs (props changed) stable/8/etc/periodic/daily/405.status-ata-raid (props changed) stable/8/etc/periodic/daily/406.status-gmirror (props changed) stable/8/etc/periodic/daily/407.status-graid3 (props changed) stable/8/etc/periodic/daily/408.status-gstripe (props changed) stable/8/etc/periodic/daily/409.status-gconcat (props changed) stable/8/etc/periodic/daily/480.status-ntpd (props changed) stable/8/etc/periodic/security/410.logincheck (props changed) stable/8/etc/periodic/security/460.chkportsum (props changed) stable/8/etc/periodic/security/510.ipfdenied (props changed) stable/8/etc/periodic/security/520.pfdenied (props changed) stable/8/etc/periodic/security/610.ipf6denied (props changed) stable/8/etc/periodic/weekly/340.noid (props changed) stable/8/etc/rc.d/Makefile (props changed) stable/8/etc/rc.d/hastd (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220109 - in stable/7/etc: periodic/daily periodic/security periodic/weekly rc.d
Author: dougb Date: Mon Mar 28 19:27:46 2011 New Revision: 220109 URL: http://svn.freebsd.org/changeset/base/220109 Log: MFC r219587, r220017, r220048 Adjust svn:executable properties Modified: Directory Properties: stable/7/etc/ (props changed) stable/7/etc/periodic/daily/404.status-zfs (props changed) stable/7/etc/periodic/daily/405.status-ata-raid (props changed) stable/7/etc/periodic/daily/406.status-gmirror (props changed) stable/7/etc/periodic/daily/407.status-graid3 (props changed) stable/7/etc/periodic/daily/408.status-gstripe (props changed) stable/7/etc/periodic/daily/409.status-gconcat (props changed) stable/7/etc/periodic/daily/480.status-ntpd (props changed) stable/7/etc/periodic/security/410.logincheck (props changed) stable/7/etc/periodic/security/510.ipfdenied (props changed) stable/7/etc/periodic/security/520.pfdenied (props changed) stable/7/etc/periodic/security/610.ipf6denied (props changed) stable/7/etc/periodic/weekly/340.noid (props changed) stable/7/etc/rc.d/Makefile (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220110 - stable/7/etc/rc.d
Author: dougb Date: Mon Mar 28 19:29:30 2011 New Revision: 220110 URL: http://svn.freebsd.org/changeset/base/220110 Log: Direct commit to update svn:executable property on remaining scripts Modified: Directory Properties: stable/7/etc/rc.d/FILESYSTEMS (props changed) stable/7/etc/rc.d/NETWORKING (props changed) stable/7/etc/rc.d/abi (props changed) stable/7/etc/rc.d/addswap (props changed) stable/7/etc/rc.d/adjkerntz (props changed) stable/7/etc/rc.d/apm (props changed) stable/7/etc/rc.d/archdep (props changed) stable/7/etc/rc.d/atm1 (props changed) stable/7/etc/rc.d/atm2 (props changed) stable/7/etc/rc.d/atm3 (props changed) stable/7/etc/rc.d/auditd (props changed) stable/7/etc/rc.d/auto_linklocal (props changed) stable/7/etc/rc.d/bgfsck (props changed) stable/7/etc/rc.d/bluetooth (props changed) stable/7/etc/rc.d/bridge (props changed) stable/7/etc/rc.d/bsnmpd (props changed) stable/7/etc/rc.d/bthidd (props changed) stable/7/etc/rc.d/cleanvar (props changed) stable/7/etc/rc.d/ddb (props changed) stable/7/etc/rc.d/devd (props changed) stable/7/etc/rc.d/devfs (props changed) stable/7/etc/rc.d/dumpon (props changed) stable/7/etc/rc.d/early.sh (props changed) stable/7/etc/rc.d/encswap (props changed) stable/7/etc/rc.d/ftp-proxy (props changed) stable/7/etc/rc.d/ftpd (props changed) stable/7/etc/rc.d/gbde (props changed) stable/7/etc/rc.d/geli (props changed) stable/7/etc/rc.d/geli2 (props changed) stable/7/etc/rc.d/hcsecd (props changed) stable/7/etc/rc.d/hostapd (props changed) stable/7/etc/rc.d/hostid (props changed) stable/7/etc/rc.d/hostname (props changed) stable/7/etc/rc.d/idmapd (props changed) stable/7/etc/rc.d/initrandom (props changed) stable/7/etc/rc.d/ip6addrctl (props changed) stable/7/etc/rc.d/ip6fw (props changed) stable/7/etc/rc.d/ipfw (props changed) stable/7/etc/rc.d/ipxrouted (props changed) stable/7/etc/rc.d/isdnd (props changed) stable/7/etc/rc.d/jail (props changed) stable/7/etc/rc.d/kadmind (props changed) stable/7/etc/rc.d/kerberos (props changed) stable/7/etc/rc.d/keyserv (props changed) stable/7/etc/rc.d/kldxref (props changed) stable/7/etc/rc.d/kpasswdd (props changed) stable/7/etc/rc.d/localpkg (props changed) stable/7/etc/rc.d/lockd (props changed) stable/7/etc/rc.d/mdconfig (props changed) stable/7/etc/rc.d/mdconfig2 (props changed) stable/7/etc/rc.d/mixer (props changed) stable/7/etc/rc.d/mountlate (props changed) stable/7/etc/rc.d/moused (props changed) stable/7/etc/rc.d/mroute6d (props changed) stable/7/etc/rc.d/msgs (props changed) stable/7/etc/rc.d/natd (props changed) stable/7/etc/rc.d/netif (props changed) stable/7/etc/rc.d/netoptions (props changed) stable/7/etc/rc.d/network_ipv6 (props changed) stable/7/etc/rc.d/nfsclient (props changed) stable/7/etc/rc.d/nfsserver (props changed) stable/7/etc/rc.d/nisdomain (props changed) stable/7/etc/rc.d/nscd (props changed) stable/7/etc/rc.d/nsswitch (props changed) stable/7/etc/rc.d/othermta (props changed) stable/7/etc/rc.d/pf (props changed) stable/7/etc/rc.d/pflog (props changed) stable/7/etc/rc.d/pfsync (props changed) stable/7/etc/rc.d/power_profile (props changed) stable/7/etc/rc.d/powerd (props changed) stable/7/etc/rc.d/ppp (props changed) stable/7/etc/rc.d/pppoed (props changed) stable/7/etc/rc.d/random (props changed) stable/7/etc/rc.d/resolv (props changed) stable/7/etc/rc.d/rfcomm_pppd_server (props changed) stable/7/etc/rc.d/routing (props changed) stable/7/etc/rc.d/sdpd (props changed) stable/7/etc/rc.d/serial (props changed) stable/7/etc/rc.d/sppp (props changed) stable/7/etc/rc.d/statd (props changed) stable/7/etc/rc.d/static_arp (props changed) stable/7/etc/rc.d/syscons (props changed) stable/7/etc/rc.d/sysctl (props changed) stable/7/etc/rc.d/tmp (props changed) stable/7/etc/rc.d/ugidfw (props changed) stable/7/etc/rc.d/var (props changed) stable/7/etc/rc.d/watchdogd (props changed) stable/7/etc/rc.d/wpa_supplicant (props changed) stable/7/etc/rc.d/ypset (props changed) stable/7/etc/rc.d/ypupdated (props changed) stable/7/etc/rc.d/ypxfrd (props changed) stable/7/etc/rc.d/zfs (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220111 - stable/8/usr.sbin/newsyslog
Author: dougb Date: Mon Mar 28 19:32:16 2011 New Revision: 220111 URL: http://svn.freebsd.org/changeset/base/220111 Log: MFC r220015: An EXAMPLE for Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 == --- stable/8/usr.sbin/newsyslog/newsyslog.conf.5Mon Mar 28 19:29:30 2011(r220110) +++ stable/8/usr.sbin/newsyslog/newsyslog.conf.5Mon Mar 28 19:32:16 2011(r220111) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd January 31, 2011 +.Dd February 25, 2011 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -349,6 +349,11 @@ If this field is not present, then a .Dv SIGHUP signal will be sent. .El +.Sh EXAMPLES +The following is an example of the +.Dq Aq Li include +entry: +.Dl " /etc/newsyslog-local.conf" .Sh SEE ALSO .Xr bzip2 1 , .Xr gzip 1 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220112 - in stable/8/etc: defaults periodic/daily periodic/security
Author: dougb Date: Mon Mar 28 19:39:53 2011 New Revision: 220112 URL: http://svn.freebsd.org/changeset/base/220112 Log: MFC r220020: Add a daily period script to back up /var/db/pkg MFC r220049: Hook the 220.backup-pkgdb script I added to the build unconditionally Hook up 610.ipf6denied based on MK_IPFILTER as 510.ipfdenied is now Added: stable/8/etc/periodic/daily/220.backup-pkgdb - copied unchanged from r220020, head/etc/periodic/daily/220.backup-pkgdb Modified: stable/8/etc/defaults/periodic.conf stable/8/etc/periodic/daily/Makefile stable/8/etc/periodic/security/Makefile Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/defaults/periodic.conf == --- stable/8/etc/defaults/periodic.conf Mon Mar 28 19:32:16 2011 (r220111) +++ stable/8/etc/defaults/periodic.conf Mon Mar 28 19:39:53 2011 (r220112) @@ -74,6 +74,10 @@ daily_backup_passwd_enable="YES" # Bac # 210.backup-aliases daily_backup_aliases_enable="YES" # Backup mail aliases +# 220.backup-pkgdb +daily_backup_pkgdb_enable="YES"# Backup /var/db/pkg +daily_backup_pkgdb_dir="/var/backups" + # 300.calendar daily_calendar_enable="NO" # Run calendar -a Copied: stable/8/etc/periodic/daily/220.backup-pkgdb (from r220020, head/etc/periodic/daily/220.backup-pkgdb) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/etc/periodic/daily/220.backup-pkgdbMon Mar 28 19:39:53 2011(r220112, copy of r220020, head/etc/periodic/daily/220.backup-pkgdb) @@ -0,0 +1,50 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then +. /etc/defaults/periodic.conf +source_periodic_confs +fi + +rc=0 + +case "$daily_backup_pkgdb_enable" in +[Yy][Ee][Ss]) + bak="${daily_backup_pkgdb_dir:-/var/backups}" + bak_file="${bak}/pkgdb.bak.tbz" + + pkg_dbdir=`make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null` + + if [ ! -d "$bak" ] + then + install -d -o root -g wheel -m 750 $bak || { + echo '$daily_backup_pkgdb_enable is enabled but' \ + "$daily_backup_pkgdb_dbdir doesn't exist" ; + exit 2 ; } + fi + + echo '' + echo 'Backing up package db directory:' + + new_bak_file=`mktemp ${bak_file}-X` + + if tar -cjf "${new_bak_file}" "$pkg_dbdir"; then + chmod 644 "${new_bak_file}" + + if [ -e "${bak_file}.2" -a -e "${bak_file}" ]; then + unlink "${bak_file}.2" + mv "${bak_file}" "${bak_file}.2" + fi + [ -e "${bak_file}" ] && mv "${bak_file}" "${bak_file}.2" + mv "${new_bak_file}" "${bak_file}" + else + rc=3 + fi ;; +esac + +exit $rc Modified: stable/8/etc/periodic/daily/Makefile == --- stable/8/etc/periodic/daily/MakefileMon Mar 28 19:32:16 2011 (r220111) +++ stable/8/etc/periodic/daily/MakefileMon Mar 28 19:39:53 2011 (r220112) @@ -6,6 +6,7 @@ FILES= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ 200.backup-passwd \ + 220.backup-pkgdb \ 330.news \ 400.status-disks \ 405.status-ata-raid \ Modified: stable/8/etc/periodic/security/Makefile == --- stable/8/etc/periodic/security/Makefile Mon Mar 28 19:32:16 2011 (r220111) +++ stable/8/etc/periodic/security/Makefile Mon Mar 28 19:39:53 2011 (r220112) @@ -17,6 +17,7 @@ FILES=100.chksetuid \ .if ${MK_IPFILTER} != "no" FILES+=510.ipfdenied +FILES+=610.ipf6denied .endif .if ${MK_IPFW} != "no" ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220113 - in stable/7/etc: defaults periodic/daily periodic/security
Author: dougb Date: Mon Mar 28 19:42:21 2011 New Revision: 220113 URL: http://svn.freebsd.org/changeset/base/220113 Log: MFC r220020: Add a daily period script to back up /var/db/pkg MFC r220049: Hook the 220.backup-pkgdb script I added to the build unconditionally Hook up 610.ipf6denied based on MK_IPFILTER as 510.ipfdenied is now Added: stable/7/etc/periodic/daily/220.backup-pkgdb - copied unchanged from r220020, head/etc/periodic/daily/220.backup-pkgdb Modified: stable/7/etc/defaults/periodic.conf stable/7/etc/periodic/daily/Makefile stable/7/etc/periodic/security/Makefile Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/periodic.conf == --- stable/7/etc/defaults/periodic.conf Mon Mar 28 19:39:53 2011 (r220112) +++ stable/7/etc/defaults/periodic.conf Mon Mar 28 19:42:21 2011 (r220113) @@ -74,6 +74,10 @@ daily_backup_passwd_enable="YES" # Bac # 210.backup-aliases daily_backup_aliases_enable="YES" # Backup mail aliases +# 220.backup-pkgdb +daily_backup_pkgdb_enable="YES"# Backup /var/db/pkg +daily_backup_pkgdb_dir="/var/backups" + # 300.calendar daily_calendar_enable="NO" # Run calendar -a Copied: stable/7/etc/periodic/daily/220.backup-pkgdb (from r220020, head/etc/periodic/daily/220.backup-pkgdb) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/etc/periodic/daily/220.backup-pkgdbMon Mar 28 19:42:21 2011(r220113, copy of r220020, head/etc/periodic/daily/220.backup-pkgdb) @@ -0,0 +1,50 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then +. /etc/defaults/periodic.conf +source_periodic_confs +fi + +rc=0 + +case "$daily_backup_pkgdb_enable" in +[Yy][Ee][Ss]) + bak="${daily_backup_pkgdb_dir:-/var/backups}" + bak_file="${bak}/pkgdb.bak.tbz" + + pkg_dbdir=`make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null` + + if [ ! -d "$bak" ] + then + install -d -o root -g wheel -m 750 $bak || { + echo '$daily_backup_pkgdb_enable is enabled but' \ + "$daily_backup_pkgdb_dbdir doesn't exist" ; + exit 2 ; } + fi + + echo '' + echo 'Backing up package db directory:' + + new_bak_file=`mktemp ${bak_file}-X` + + if tar -cjf "${new_bak_file}" "$pkg_dbdir"; then + chmod 644 "${new_bak_file}" + + if [ -e "${bak_file}.2" -a -e "${bak_file}" ]; then + unlink "${bak_file}.2" + mv "${bak_file}" "${bak_file}.2" + fi + [ -e "${bak_file}" ] && mv "${bak_file}" "${bak_file}.2" + mv "${new_bak_file}" "${bak_file}" + else + rc=3 + fi ;; +esac + +exit $rc Modified: stable/7/etc/periodic/daily/Makefile == --- stable/7/etc/periodic/daily/MakefileMon Mar 28 19:39:53 2011 (r220112) +++ stable/7/etc/periodic/daily/MakefileMon Mar 28 19:42:21 2011 (r220113) @@ -6,6 +6,7 @@ FILES= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ 200.backup-passwd \ + 220.backup-pkgdb \ 330.news \ 400.status-disks \ 404.status-zfs \ Modified: stable/7/etc/periodic/security/Makefile == --- stable/7/etc/periodic/security/Makefile Mon Mar 28 19:39:53 2011 (r220112) +++ stable/7/etc/periodic/security/Makefile Mon Mar 28 19:42:21 2011 (r220113) @@ -16,6 +16,7 @@ FILES=100.chksetuid \ .if ${MK_IPFILTER} != "no" FILES+=510.ipfdenied +FILES+=610.ipf6denied .endif .if ${MK_IPFW} != "no" ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220114 - head/sys/kern
Author: kib Date: Mon Mar 28 19:44:54 2011 New Revision: 220114 URL: http://svn.freebsd.org/changeset/base/220114 Log: Fix the check for vm_map_remove() error. Pointed out by: alc MFC after:2 weeks Modified: head/sys/kern/subr_uio.c Modified: head/sys/kern/subr_uio.c == --- head/sys/kern/subr_uio.cMon Mar 28 19:42:21 2011(r220113) +++ head/sys/kern/subr_uio.cMon Mar 28 19:44:54 2011(r220114) @@ -506,7 +506,7 @@ copyout_unmap(struct thread *td, vm_offs map = &td->td_proc->p_vmspace->vm_map; size = (vm_size_t)round_page(sz); - if (!vm_map_remove(map, addr, addr + size)) + if (vm_map_remove(map, addr, addr + size) != KERN_SUCCESS) return (EINVAL); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220115 - stable/8/lib/libc/string
Author: jilles Date: Mon Mar 28 22:50:02 2011 New Revision: 220115 URL: http://svn.freebsd.org/changeset/base/220115 Log: MFC r219803: index(3): Mention that index/rindex are deprecated and not specified by POSIX.1-2008. Modified: stable/8/lib/libc/string/index.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/string/index.3 == --- stable/8/lib/libc/string/index.3Mon Mar 28 19:44:54 2011 (r220114) +++ stable/8/lib/libc/string/index.3Mon Mar 28 22:50:02 2011 (r220115) @@ -30,7 +30,7 @@ .\" @(#)index.38.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd March 20, 2011 .Dt INDEX 3 .Os .Sh NAME @@ -45,6 +45,17 @@ .Ft "char *" .Fn rindex "const char *s" "int c" .Sh DESCRIPTION +.Bf -symbolic +The +.Fn index +and +.Fn rindex +functions have been deprecated in favor of +.Xr strchr 3 +and +.Xr strrchr 3 . +.Ef +.Pp The .Fn index function @@ -100,3 +111,5 @@ before they were moved to for .St -p1003.1-2001 compliance. +The functions are not specified by +.St -p1003.1-2008 . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220116 - head/usr.sbin/bluetooth/l2ping
Author: emax Date: Mon Mar 28 23:08:18 2011 New Revision: 220116 URL: http://svn.freebsd.org/changeset/base/220116 Log: Do not use word 'flood' as it not entirely correct. Use better 'no delay' description. While here, replace atoi(3) with strtol(3). Submitted by: arundel MFC after:1 week Modified: head/usr.sbin/bluetooth/l2ping/l2ping.8 head/usr.sbin/bluetooth/l2ping/l2ping.c Modified: head/usr.sbin/bluetooth/l2ping/l2ping.8 == --- head/usr.sbin/bluetooth/l2ping/l2ping.8 Mon Mar 28 22:50:02 2011 (r220115) +++ head/usr.sbin/bluetooth/l2ping/l2ping.8 Mon Mar 28 23:08:18 2011 (r220116) @@ -25,7 +25,7 @@ .\" $Id: l2ping.8,v 1.3 2003/05/21 01:00:19 max Exp $ .\" $FreeBSD$ .\" -.Dd June 14, 2002 +.Dd March 29, 2011 .Dt L2PING 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Op Fl fhn .Fl a Ar remote .Op Fl c Ar count -.Op Fl i Ar delay +.Op Fl i Ar wait .Op Fl S Ar source .Op Fl s Ar size .Sh DESCRIPTION @@ -63,8 +63,7 @@ If this option is not specified, .Nm will operate until interrupted. .It Fl f -.Dq Flood -ping, i.e., no delay between packets. +Don't wait between sending each packet. .It Fl h Display usage message and exit. .It Fl i Ar wait @@ -109,7 +108,7 @@ Some implementations may not like large .Xr ng_l2cap 4 , .Xr l2control 8 .Sh AUTHORS -.An Maksim Yevmenkin Aq m_evmen...@yahoo.com +.An Maksim Yevmenkin Aq e...@freebsd.org .Sh BUGS Could collect more statistic. Could check for duplicated, corrupted and lost packets. Modified: head/usr.sbin/bluetooth/l2ping/l2ping.c == --- head/usr.sbin/bluetooth/l2ping/l2ping.c Mon Mar 28 22:50:02 2011 (r220115) +++ head/usr.sbin/bluetooth/l2ping/l2ping.c Mon Mar 28 23:08:18 2011 (r220116) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -60,11 +61,11 @@ int main(int argc, char *argv[]) { bdaddr_t src, dst; - struct hostent *he = NULL; - uint8_t *echo_data = NULL; + struct hostent *he; + uint8_t *echo_data; struct sockaddr_l2capsa; int32_t n, s, count, wait, flood, echo_size, numeric; - char*rname = NULL; + char*endp, *rname; /* Set defaults */ memcpy(&src, NG_HCI_BDADDR_ANY, sizeof(src)); @@ -100,8 +101,8 @@ main(int argc, char *argv[]) break; case 'c': - count = atoi(optarg); - if (count <= 0) + count = strtol(optarg, &endp, 10); + if (count <= 0 || *endp != '\0') usage(); break; @@ -110,8 +111,8 @@ main(int argc, char *argv[]) break; case 'i': - wait = atoi(optarg); - if (wait <= 0) + wait = strtol(optarg, &endp, 10); + if (wait <= 0 || *endp != '\0') usage(); break; @@ -129,9 +130,10 @@ main(int argc, char *argv[]) break; case 's': - echo_size = atoi(optarg); - if (echo_size < sizeof(int32_t) || - echo_size > NG_L2CAP_MAX_ECHO_SIZE) +echo_size = strtol(optarg, &endp, 10); +if (echo_size < sizeof(int32_t) || + echo_size > NG_L2CAP_MAX_ECHO_SIZE || + *endp != '\0') usage(); break; @@ -272,12 +274,12 @@ tv2msec(struct timeval const *tvp) static void usage(void) { - fprintf(stderr, "Usage: l2ping -a bd_addr " \ - "[-S bd_addr -c count -i wait -n -s size -h]\n"); + fprintf(stderr, "Usage: l2ping [-fhn] -a remote " \ + "[-c count] [-i wait] [-S source] [-s size]\n"); fprintf(stderr, "Where:\n"); fprintf(stderr, " -a remote Specify remote device to ping\n"); fprintf(stderr, " -c count Number of packets to send\n"); - fprintf(stderr, " -f No delay (sort of flood)\n"); + fprintf(stderr, " -f No delay between packets\n"); fprintf(stderr, " -h Display this message\n"); fprintf(stderr, " -i waitDelay between packets (sec)\n"); fprintf(stderr, " -n Numeric output only\n"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220059 - head/usr.sbin/pc-sysinstall/backend
On 03/27/2011 15:29, Warner Losh wrote: On Mar 27, 2011, at 11:22 AM, Doug Barton wrote: On 03/27/2011 09:57, Josh Paetzel wrote: Replace "$?" = "0" with $? -eq 0 in tests Excellent! Most of the time I've found that moving the command up to the if makes the code clearer too. At jobs I've had in the past when I've written code similar to what we have here, it almost always got flagged... In general I agree with you. I did take a look at the specific cases where the -eq 0 changes were made and IMO it's about 50/50 whether that would actually be an optimization, or if leaving it as is makes the code more readable. I chose to go with "focus on the positive." :) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On 03/21/2011 00:33, Jeff Roberson wrote: On Sun, 20 Mar 2011, Doug Barton wrote: On 03/20/2011 09:22, Marius Strobl wrote: I fear it's still a bit premature for enable SU+J by default. Rather recently I was told about a SU+J filesystems lost after a panic that happend after snapshotting it (report CC'ed, maybe he can provide some more details) and I'm pretty sure I've seen the problem described in PR 149022 also after the potential fix mentioned in its feedback. +1 I tried enabling SU+J on my /var (after backing up of course) and after a panic random files were missing entirely. Not the last updates to those files, the whole file, and many of them had not been written to in days/weeks/months. So you're saying the directory entry was missing? I'm saying that the file wasn't visible to 'ls /var/db/pkg/foo/'. I didn't debug it past determining that the files were missing. Can you tell me how big the directory was? Most of the damage was in /var/db/pkg/, so the individual directories that were missing files were small, no more than 10 files each. I imagine there was probably other damaged scattered throughout /var, but once I learned how many files were missing I just nuked it and restored from backup. Number of files? I stopped counting around 20 or so. Approximate directory size when you consider file names? When you fsck'd were inodes recovered and linked into lost and found? No. What was the actual path? To the lost files? The ones that I actually noticed missing were all /var/db/pkg/*/+CONTENTS. There were probably a lot of other files missing, but those were noticeable because the ports tree was throwing errors, and a missing +CONTENTS file can't be recovered from without re-installing the port. I'm trying to wrap my head around how this would be possible and where the error could be and whether it could be caused by SUJ. It never happened before enabling SUJ, happened shortly after I did, and has never happened since I disabled it. It's probably worth reiterating that the damage happened after an actual panic, as opposed to during "regular" operation. The number of interactions with disk writes are minimal. Corruption if it occurs would most likely be caused by a bad journal recovery. Unlikely in this case, since the damage was not confined to recently-written files. hth, Doug PS, my primary concern was that we not enable this by default until it can be demonstrated to be more robust. However Nathan has already enabled it in the new installer, so now perhaps it would be fitting to send a message to -current letting people know that the plan is to have it on by default in 9.0, and asking people to resume more rigorous testing. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220124 - head/sys/modules/ipfw
Author: ae Date: Tue Mar 29 06:42:52 2011 New Revision: 220124 URL: http://svn.freebsd.org/changeset/base/220124 Log: Do not build ip_fw_nat.c for ipfw.ko. It can be build as separate module. MFC after:1 week Modified: head/sys/modules/ipfw/Makefile Modified: head/sys/modules/ipfw/Makefile == --- head/sys/modules/ipfw/Makefile Tue Mar 29 05:58:09 2011 (r220123) +++ head/sys/modules/ipfw/Makefile Tue Mar 29 06:42:52 2011 (r220124) @@ -6,7 +6,7 @@ KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c -SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_nat.c +SRCS+= ip_fw_dynamic.c ip_fw_log.c SRCS+= ip_fw_sockopt.c ip_fw_table.c SRCS+= opt_inet6.h opt_ipsec.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"