From owner-svn-src-projects@FreeBSD.ORG Sat Nov 8 18:13:43 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29E57AF6; Sat, 8 Nov 2014 18:13:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11A21B92; Sat, 8 Nov 2014 18:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA8IDgnA052061; Sat, 8 Nov 2014 18:13:42 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA8IDaFc052026; Sat, 8 Nov 2014 18:13:36 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411081813.sA8IDaFc052026@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 8 Nov 2014 18:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r274298 - in projects/routing: . bin/df bin/sh cddl/contrib/opensolaris/cmd/zdb contrib/llvm/lib/MC/MCParser contrib/llvm/patches contrib/netbsd-tests/lib/libc/sys contrib/openpam/t con... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 18:13:43 -0000 Author: melifaro Date: Sat Nov 8 18:13:35 2014 New Revision: 274298 URL: https://svnweb.freebsd.org/changeset/base/274298 Log: Sync to HEAD@r274297. Added: projects/routing/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff - copied unchanged from r274297, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff projects/routing/lib/libdpv/ - copied from r274297, head/lib/libdpv/ projects/routing/lib/libfigpar/ - copied from r274297, head/lib/libfigpar/ projects/routing/lib/libpam/libpam/tests/ - copied from r274297, head/lib/libpam/libpam/tests/ projects/routing/share/man/man4/me.4 - copied unchanged from r274297, head/share/man/man4/me.4 projects/routing/sys/compat/svr4/README - copied unchanged from r274297, head/sys/compat/svr4/README projects/routing/sys/compat/svr4/TO-DO - copied unchanged from r274297, head/sys/compat/svr4/TO-DO projects/routing/sys/dev/ixl/ixlv_vc_mgr.h - copied unchanged from r274297, head/sys/dev/ixl/ixlv_vc_mgr.h projects/routing/sys/modules/if_me/ - copied from r274297, head/sys/modules/if_me/ projects/routing/sys/net/if_me.c - copied unchanged from r274297, head/sys/net/if_me.c projects/routing/sys/netinet6/ip6_gre.c - copied, changed from r274297, head/sys/netinet6/ip6_gre.c projects/routing/tools/build/check-links.sh - copied unchanged from r274297, head/tools/build/check-links.sh projects/routing/usr.bin/dpv/ - copied from r274297, head/usr.bin/dpv/ Deleted: projects/routing/sys/modules/svr4/README projects/routing/sys/modules/svr4/TO-DO projects/routing/sys/netinet/ip_gre.h Modified: projects/routing/Makefile.inc1 projects/routing/bin/df/Makefile projects/routing/bin/df/df.1 projects/routing/bin/df/df.c projects/routing/bin/sh/sh.1 projects/routing/cddl/contrib/opensolaris/cmd/zdb/zdb.c projects/routing/contrib/llvm/lib/MC/MCParser/AsmParser.cpp projects/routing/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c projects/routing/contrib/netbsd-tests/lib/libc/sys/t_mincore.c projects/routing/contrib/openpam/t/t_openpam_ctype.c projects/routing/contrib/openpam/t/t_openpam_readlinev.c projects/routing/contrib/openpam/t/t_openpam_readword.c projects/routing/contrib/tnftp/src/fetch.c projects/routing/etc/mtree/BSD.tests.dist projects/routing/etc/periodic/security/Makefile projects/routing/etc/rc.d/growfs projects/routing/gnu/lib/libdialog/Makefile projects/routing/lib/Makefile projects/routing/lib/libpam/libpam/Makefile projects/routing/rescue/rescue/Makefile projects/routing/sbin/fsirand/Makefile projects/routing/sbin/ifconfig/ifgre.c projects/routing/share/man/man4/Makefile projects/routing/share/man/man4/gre.4 projects/routing/share/man/man9/domain.9 projects/routing/share/mk/bsd.lib.mk projects/routing/share/mk/bsd.libnames.mk projects/routing/share/mk/bsd.obj.mk projects/routing/share/mk/bsd.own.mk projects/routing/share/mk/bsd.prog.mk projects/routing/sys/amd64/amd64/support.S projects/routing/sys/amd64/conf/GENERIC projects/routing/sys/arm/arm/busdma_machdep-v6.c projects/routing/sys/boot/common/misc.c projects/routing/sys/cam/ctl/ctl.c projects/routing/sys/cam/ctl/ctl.h projects/routing/sys/cam/ctl/ctl_backend.h projects/routing/sys/cam/ctl/ctl_backend_block.c projects/routing/sys/cam/ctl/ctl_error.c projects/routing/sys/cam/ctl/ctl_private.h projects/routing/sys/cam/scsi/scsi_all.h projects/routing/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c projects/routing/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c projects/routing/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c projects/routing/sys/conf/NOTES projects/routing/sys/conf/files projects/routing/sys/conf/kmod.mk projects/routing/sys/dev/ahci/ahci.c projects/routing/sys/dev/hyperv/netvsc/hv_net_vsc.c projects/routing/sys/dev/hyperv/netvsc/hv_net_vsc.h projects/routing/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c projects/routing/sys/dev/ida/ida_eisa.c projects/routing/sys/dev/ixl/i40e_osdep.c projects/routing/sys/dev/ixl/i40e_osdep.h projects/routing/sys/dev/ixl/if_ixl.c projects/routing/sys/dev/ixl/if_ixlv.c projects/routing/sys/dev/ixl/ixl.h projects/routing/sys/dev/ixl/ixl_txrx.c projects/routing/sys/dev/ixl/ixlv.h projects/routing/sys/dev/ixl/ixlvc.c projects/routing/sys/dev/ofw/ofwbus.c projects/routing/sys/dev/random/fortuna.c projects/routing/sys/dev/random/ivy.c projects/routing/sys/dev/random/nehemiah.c projects/routing/sys/dev/random/randomdev.c projects/routing/sys/dev/random/randomdev_soft.c projects/routing/sys/dev/sound/pci/spicds.c projects/routing/sys/dev/usb/serial/u3g.c projects/routing/sys/dev/usb/usbdevs projects/routing/sys/dev/virtio/console/virtio_console.c projects/routing/sys/dev/vt/vt.h projects/routing/sys/geom/geom_dev.c projects/routing/sys/kern/kern_descrip.c projects/routing/sys/kern/kern_prot.c projects/routing/sys/kern/uipc_debug.c projects/routing/sys/kern/vfs_export.c projects/routing/sys/modules/Makefile projects/routing/sys/modules/if_gre/Makefile projects/routing/sys/modules/ixlv/Makefile projects/routing/sys/modules/linux/Makefile projects/routing/sys/modules/mrsas/Makefile projects/routing/sys/modules/random/Makefile projects/routing/sys/modules/sound/sound/Makefile projects/routing/sys/modules/svr4/Makefile projects/routing/sys/modules/vmm/Makefile projects/routing/sys/net/bpf.c projects/routing/sys/net/flowtable.c projects/routing/sys/net/if.c projects/routing/sys/net/if_arp.h projects/routing/sys/net/if_bridge.c projects/routing/sys/net/if_disc.c projects/routing/sys/net/if_ethersubr.c projects/routing/sys/net/if_faith.c projects/routing/sys/net/if_fddisubr.c projects/routing/sys/net/if_gif.c projects/routing/sys/net/if_gre.c projects/routing/sys/net/if_gre.h projects/routing/sys/net/if_iso88025subr.c projects/routing/sys/net/if_loop.c projects/routing/sys/net/if_mib.c projects/routing/sys/net/if_stf.c projects/routing/sys/net/if_var.h projects/routing/sys/net/route.c projects/routing/sys/net/vnet.h projects/routing/sys/netgraph/ng_ether.c projects/routing/sys/netinet/cc/cc.c projects/routing/sys/netinet/cc/cc_cdg.c projects/routing/sys/netinet/cc/cc_chd.c projects/routing/sys/netinet/cc/cc_hd.c projects/routing/sys/netinet/cc/cc_htcp.c projects/routing/sys/netinet/cc/cc_vegas.c projects/routing/sys/netinet/if_ether.c projects/routing/sys/netinet/igmp.c projects/routing/sys/netinet/in.c projects/routing/sys/netinet/in_gif.c projects/routing/sys/netinet/in_pcb.c projects/routing/sys/netinet/in_proto.c projects/routing/sys/netinet/in_rmx.c projects/routing/sys/netinet/ip_carp.c projects/routing/sys/netinet/ip_fastfwd.c projects/routing/sys/netinet/ip_gre.c projects/routing/sys/netinet/ip_icmp.c projects/routing/sys/netinet/ip_input.c projects/routing/sys/netinet/ip_ipsec.c projects/routing/sys/netinet/ip_mroute.c projects/routing/sys/netinet/raw_ip.c projects/routing/sys/netinet/tcp_hostcache.c projects/routing/sys/netinet/tcp_input.c projects/routing/sys/netinet/tcp_output.c projects/routing/sys/netinet/tcp_sack.c projects/routing/sys/netinet/tcp_subr.c projects/routing/sys/netinet/tcp_syncache.c projects/routing/sys/netinet/tcp_timewait.c projects/routing/sys/netinet/udp_usrreq.c projects/routing/sys/netinet6/in6.c projects/routing/sys/netinet6/in6_gif.c projects/routing/sys/netinet6/in6_proto.c projects/routing/sys/netinet6/in6_rmx.c projects/routing/sys/netinet6/in6_var.h projects/routing/sys/netinet6/ip6_ipsec.c projects/routing/sys/netinet6/mld6.c projects/routing/sys/netinet6/nd6.c projects/routing/sys/netinet6/scope6.c projects/routing/sys/netipsec/ipsec.c projects/routing/sys/netipsec/ipsec_input.c projects/routing/sys/netipsec/key.c projects/routing/sys/netipsec/xform_ah.c projects/routing/sys/netipsec/xform_esp.c projects/routing/sys/netipsec/xform_ipcomp.c projects/routing/sys/netipsec/xform_ipip.c projects/routing/sys/netpfil/ipfw/ip_fw2.c projects/routing/sys/netpfil/ipfw/ip_fw_dynamic.c projects/routing/sys/netpfil/ipfw/ip_fw_pfil.c projects/routing/sys/netpfil/pf/if_pfsync.c projects/routing/sys/sys/conf.h projects/routing/sys/sys/disk.h projects/routing/sys/sys/domain.h projects/routing/sys/sys/param.h projects/routing/sys/sys/sysctl.h projects/routing/sys/sys/ucred.h projects/routing/sys/sys/user.h projects/routing/sys/vm/default_pager.c projects/routing/sys/vm/swap_pager.c projects/routing/sys/vm/vm_page.c projects/routing/tests/sys/netinet/Makefile projects/routing/usr.bin/Makefile projects/routing/usr.bin/ftp/Makefile projects/routing/usr.bin/iconv/Makefile projects/routing/usr.bin/id/Makefile projects/routing/usr.bin/w/Makefile projects/routing/usr.bin/w/pr_time.c projects/routing/usr.bin/w/w.1 projects/routing/usr.bin/w/w.c projects/routing/usr.bin/wc/Makefile projects/routing/usr.bin/wc/wc.1 projects/routing/usr.bin/wc/wc.c projects/routing/usr.sbin/ctladm/ctladm.8 projects/routing/usr.sbin/ctld/Makefile projects/routing/usr.sbin/ctld/ctl.conf.5 projects/routing/usr.sbin/ctld/ctld.c projects/routing/usr.sbin/fifolog/fifolog_reader/Makefile projects/routing/usr.sbin/fifolog/fifolog_writer/Makefile projects/routing/usr.sbin/iscsid/Makefile projects/routing/usr.sbin/rpcbind/Makefile projects/routing/usr.sbin/sysrc/sysrc.8 Directory Properties: projects/routing/ (props changed) projects/routing/cddl/ (props changed) projects/routing/cddl/contrib/opensolaris/ (props changed) projects/routing/contrib/llvm/ (props changed) projects/routing/contrib/openpam/ (props changed) projects/routing/contrib/tnftp/ (props changed) projects/routing/etc/ (props changed) projects/routing/gnu/lib/ (props changed) projects/routing/sbin/ (props changed) projects/routing/share/ (props changed) projects/routing/share/man/man4/ (props changed) projects/routing/sys/ (props changed) projects/routing/sys/boot/ (props changed) projects/routing/sys/cddl/contrib/opensolaris/ (props changed) projects/routing/sys/conf/ (props changed) projects/routing/sys/dev/hyperv/ (props changed) projects/routing/sys/modules/vmm/ (props changed) Modified: projects/routing/Makefile.inc1 ============================================================================== --- projects/routing/Makefile.inc1 Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/Makefile.inc1 Sat Nov 8 18:13:35 2014 (r274298) @@ -1537,6 +1537,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libwind} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libelf lib/libexpat \ + lib/libfigpar \ ${_lib_libgssapi} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ ${_lib_libcapsicum} \ @@ -1551,7 +1552,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_cddl_lib_libctf} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ - ${_secure_lib_libssh} ${_secure_lib_libssl} + ${_secure_lib_libssh} ${_secure_lib_libssl} \ + gnu/lib/libdialog .if ${MK_GNUCXX} != "no" _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L @@ -1669,6 +1671,8 @@ _lib_libypclnt= lib/libypclnt lib/libradius__L: lib/libmd__L .endif +gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L + .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) Modified: projects/routing/bin/df/Makefile ============================================================================== --- projects/routing/bin/df/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/bin/df/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -9,7 +9,7 @@ SRCS= df.c vfslist.c CFLAGS+= -I${MOUNT} -DPADD= ${LIBUTIL} -LDADD= -lutil +DPADD= ${LIBUTIL} ${LIBXO} +LDADD= -lutil -lxo .include Modified: projects/routing/bin/df/df.1 ============================================================================== --- projects/routing/bin/df/df.1 Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/bin/df/df.1 Sat Nov 8 18:13:35 2014 (r274298) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd January 16, 2014 +.Dd November 6, 2014 .Dt DF 1 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nd display free disk space .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl b | g | H | h | k | m | P .Op Fl acilnT .Op Fl \&, @@ -193,7 +194,9 @@ If the value is outside, it will be set .Xr statfs 2 , .Xr getbsize 3 , .Xr getmntinfo 3 , +.Xr libxo 3 , .Xr localeconv 3 , +.Xr xo_parse_args 3 , .Xr fstab 5 , .Xr mount 8 , .Xr pstat 8 , Modified: projects/routing/bin/df/df.c ============================================================================== --- projects/routing/bin/df/df.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/bin/df/df.c Sat Nov 8 18:13:35 2014 (r274298) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" @@ -82,7 +83,7 @@ static char *getmntpt(const char *); static int int64width(int64_t); static char *makenetvfslist(void); static void prthuman(const struct statfs *, int64_t); -static void prthumanval(int64_t); +static void prthumanval(const char *, int64_t); static intmax_t fsbtoblk(int64_t, uint64_t, u_long); static void prtstat(struct statfs *, struct maxwidths *); static size_t regetmntinfo(struct statfs **, long, const char **); @@ -119,6 +120,11 @@ main(int argc, char *argv[]) totalbuf.f_bsize = DEV_BSIZE; strlcpy(totalbuf.f_mntfromname, "total", MNAMELEN); vfslist = NULL; + + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(1); + while ((ch = getopt(argc, argv, "abcgHhiklmnPt:T,")) != -1) switch (ch) { case 'a': @@ -161,7 +167,7 @@ main(int argc, char *argv[]) break; case 'l': if (vfslist != NULL) - errx(1, "-l and -t are mutually exclusive."); + xo_errx(1, "-l and -t are mutually exclusive."); vfslist = makevfslist(makenetvfslist()); lflag = 1; break; @@ -174,9 +180,9 @@ main(int argc, char *argv[]) break; case 't': if (lflag) - errx(1, "-l and -t are mutually exclusive."); + xo_errx(1, "-l and -t are mutually exclusive."); if (vfslist != NULL) - errx(1, "only one -t option may be specified"); + xo_errx(1, "only one -t option may be specified"); fstype = optarg; vfslist = makevfslist(optarg); break; @@ -202,16 +208,19 @@ main(int argc, char *argv[]) /* just the filesystems specified on the command line */ mntbuf = malloc(argc * sizeof(*mntbuf)); if (mntbuf == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); mntsize = 0; /* continued in for loop below */ } + xo_open_container("storage-system-information"); + xo_open_list("filesystem"); + /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == NULL) { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; continue; } @@ -220,20 +229,20 @@ main(int argc, char *argv[]) mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { - warn("strdup failed"); + xo_warn("strdup failed"); rv = 1; continue; } mntpt = mkdtemp(mntpath); if (mntpt == NULL) { - warn("mkdtemp(\"%s\") failed", mntpath); + xo_warn("mkdtemp(\"%s\") failed", mntpath); rv = 1; free(mntpath); continue; } if (mount(fstype, mntpt, MNT_RDONLY, &mdev) != 0) { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; (void)rmdir(mntpt); free(mntpath); @@ -244,7 +253,7 @@ main(int argc, char *argv[]) if (cflag) addstat(&totalbuf, &statfsbuf); } else { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; } (void)unmount(mntpt, 0); @@ -260,7 +269,7 @@ main(int argc, char *argv[]) * implement nflag here. */ if (statfs(mntpt, &statfsbuf) < 0) { - warn("%s", mntpt); + xo_warn("%s", mntpt); rv = 1; continue; } @@ -294,8 +303,14 @@ main(int argc, char *argv[]) for (i = 0; i < mntsize; i++) if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) prtstat(&mntbuf[i], &maxwidths); + + xo_close_list("filesystem"); + if (cflag) prtstat(&totalbuf, &maxwidths); + + xo_close_container("storage-system-information"); + xo_finish(); return (rv); } @@ -341,7 +356,7 @@ regetmntinfo(struct statfs **mntbufp, lo if (nflag || error < 0) if (i != j) { if (error < 0) - warnx("%s stats possibly stale", + xo_warnx("%s stats possibly stale", mntbuf[i].f_mntonname); mntbuf[j] = mntbuf[i]; } @@ -354,13 +369,13 @@ static void prthuman(const struct statfs *sfsp, int64_t used) { - prthumanval(sfsp->f_blocks * sfsp->f_bsize); - prthumanval(used * sfsp->f_bsize); - prthumanval(sfsp->f_bavail * sfsp->f_bsize); + prthumanval(" {:blocks/%6s}", sfsp->f_blocks * sfsp->f_bsize); + prthumanval(" {:used/%6s}", used * sfsp->f_bsize); + prthumanval(" {:available/%6s}", sfsp->f_bavail * sfsp->f_bsize); } static void -prthumanval(int64_t bytes) +prthumanval(const char *fmt, int64_t bytes) { char buf[6]; int flags; @@ -372,14 +387,15 @@ prthumanval(int64_t bytes) humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), bytes, "", HN_AUTOSCALE, flags); - (void)printf(" %6s", buf); + xo_attr("value", "%lld", (long long) bytes); + xo_emit(fmt, buf); } /* * Print an inode count in "human-readable" format. */ static void -prthumanvalinode(int64_t bytes) +prthumanvalinode(const char *fmt, int64_t bytes) { char buf[6]; int flags; @@ -389,7 +405,8 @@ prthumanvalinode(int64_t bytes) humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), bytes, "", HN_AUTOSCALE, flags); - (void)printf(" %5s", buf); + xo_attr("value", "%lld", (long long) bytes); + xo_emit(fmt, buf); } /* @@ -434,70 +451,77 @@ prtstat(struct statfs *sfsp, struct maxw mwp->used = imax(mwp->used, (int)strlen("Used")); mwp->avail = imax(mwp->avail, (int)strlen("Avail")); - (void)printf("%-*s", mwp->mntfrom, "Filesystem"); + xo_emit("{T:/%-*s}", mwp->mntfrom, "Filesystem"); if (Tflag) - (void)printf(" %-*s", mwp->fstype, "Type"); - (void)printf(" %*s %*s %*s Capacity", mwp->total, header, - mwp->used, "Used", mwp->avail, "Avail"); + xo_emit(" {T:/%-*s}", mwp->fstype, "Type"); + xo_emit(" {T:/%*s} {T:/%*s} {T:/%*s} Capacity", + mwp->total, header, + mwp->used, "Used", mwp->avail, "Avail"); if (iflag) { mwp->iused = imax(hflag ? 0 : mwp->iused, (int)strlen(" iused")); mwp->ifree = imax(hflag ? 0 : mwp->ifree, (int)strlen("ifree")); - (void)printf(" %*s %*s %%iused", + xo_emit(" {T:/%*s} {T:/%*s} {T:\%iused}", mwp->iused - 2, "iused", mwp->ifree, "ifree"); } - (void)printf(" Mounted on\n"); + xo_emit(" {T:Mounted on}\n"); } + + xo_open_instance("filesystem"); /* Check for 0 block size. Can this happen? */ if (sfsp->f_bsize == 0) { - warnx ("File system %s does not have a block size, assuming 512.", + xo_warnx ("File system %s does not have a block size, assuming 512.", sfsp->f_mntonname); sfsp->f_bsize = 512; } - (void)printf("%-*s", mwp->mntfrom, sfsp->f_mntfromname); + xo_emit("{tk:name/%-*s}", mwp->mntfrom, sfsp->f_mntfromname); if (Tflag) - (void)printf(" %-*s", mwp->fstype, sfsp->f_fstypename); + xo_emit(" {:type/%-*s}", mwp->fstype, sfsp->f_fstypename); used = sfsp->f_blocks - sfsp->f_bfree; availblks = sfsp->f_bavail + used; if (hflag) { prthuman(sfsp, used); } else { if (thousands) - format = " %*j'd %*j'd %*j'd"; + format = " {t:total-blocks/%*j'd} {t:used-blocks/%*j'd} " + "{t:available-blocks/%*j'd}"; else - format = " %*jd %*jd %*jd"; - (void)printf(format, + format = " {t:total-blocks/%*jd} {t:used-blocks/%*jd} " + "{t:available-blocks/%*jd}"; + xo_emit(format, mwp->total, fsbtoblk(sfsp->f_blocks, sfsp->f_bsize, blocksize), mwp->used, fsbtoblk(used, sfsp->f_bsize, blocksize), mwp->avail, fsbtoblk(sfsp->f_bavail, sfsp->f_bsize, blocksize)); } - (void)printf(" %5.0f%%", + xo_emit(" {:used-percent/%5.0f}{U:%%}", availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (iflag) { inodes = sfsp->f_files; used = inodes - sfsp->f_ffree; if (hflag) { - (void)printf(" "); - prthumanvalinode(used); - prthumanvalinode(sfsp->f_ffree); + xo_emit(" "); + prthumanvalinode(" {:inodes-used/%5s}", used); + prthumanvalinode(" {:inodes-free/%5s}", sfsp->f_ffree); } else { if (thousands) - format = " %*j'd %*j'd"; + format = " {:inodes-used/%*j'd} {:inodes-free/%*j'd}"; else - format = " %*jd %*jd"; - (void)printf(format, mwp->iused, (intmax_t)used, + format = " {:inodes-used/%*jd} {:inodes-free/%*jd}"; + xo_emit(format, mwp->iused, (intmax_t)used, mwp->ifree, (intmax_t)sfsp->f_ffree); } - (void)printf(" %4.0f%% ", inodes == 0 ? 100.0 : - (double)used / (double)inodes * 100.0); + xo_emit(" {:inodes-used-percent/%4.0f}{U:%%} ", + inodes == 0 ? 100.0 : + (double)used / (double)inodes * 100.0); } else - (void)printf(" "); + xo_emit(" "); if (strncmp(sfsp->f_mntfromname, "total", MNAMELEN) != 0) - (void)printf(" %s", sfsp->f_mntonname); - (void)printf("\n"); + xo_emit(" {:mounted-on}", sfsp->f_mntonname); + xo_emit("\n"); + xo_close_instance("filesystem"); } static void @@ -564,7 +588,7 @@ static void usage(void) { - (void)fprintf(stderr, + xo_error( "usage: df [-b | -g | -H | -h | -k | -m | -P] [-acilnT] [-t type] [-,]\n" " [file | filesystem ...]\n"); exit(EX_USAGE); @@ -579,24 +603,24 @@ makenetvfslist(void) int cnt, i, maxvfsconf; if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0) { - warn("sysctl(vfs.conflist)"); + xo_warn("sysctl(vfs.conflist)"); return (NULL); } xvfsp = malloc(buflen); if (xvfsp == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); return (NULL); } keep_xvfsp = xvfsp; if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) { - warn("sysctl(vfs.conflist)"); + xo_warn("sysctl(vfs.conflist)"); free(keep_xvfsp); return (NULL); } maxvfsconf = buflen / sizeof(struct xvfsconf); if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); free(keep_xvfsp); return (NULL); } @@ -605,7 +629,7 @@ makenetvfslist(void) if (xvfsp->vfc_flags & VFCF_NETWORK) { listptr[cnt++] = strdup(xvfsp->vfc_name); if (listptr[cnt-1] == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); free(listptr); free(keep_xvfsp); return (NULL); @@ -617,7 +641,7 @@ makenetvfslist(void) if (cnt == 0 || (str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { if (cnt > 0) - warnx("malloc failed"); + xo_warnx("malloc failed"); free(listptr); free(keep_xvfsp); return (NULL); Modified: projects/routing/bin/sh/sh.1 ============================================================================== --- projects/routing/bin/sh/sh.1 Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/bin/sh/sh.1 Sat Nov 8 18:13:35 2014 (r274298) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd September 21, 2014 +.Dd November 7, 2014 .Dt SH 1 .Os .Sh NAME @@ -2522,7 +2522,8 @@ and so on, decreasing the value of .Li $# by one. -If there are zero positional parameters, shifting does not do anything. +For portability, shifting if there are zero positional parameters +should be avoided, since the shell may abort. .It Ic test A built-in equivalent of .Xr test 1 . Modified: projects/routing/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- projects/routing/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 8 18:13:35 2014 (r274298) @@ -77,9 +77,11 @@ #ifndef lint extern boolean_t zfs_recover; extern uint64_t zfs_arc_max, zfs_arc_meta_limit; +extern int zfs_vdev_async_read_max_active; #else boolean_t zfs_recover; uint64_t zfs_arc_max, zfs_arc_meta_limit; +int zfs_vdev_async_read_max_active; #endif const char cmdname[] = "zdb"; @@ -2384,8 +2386,14 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] < 5 && - gethrtime() > zcb->zcb_lastprint + NANOSEC) { + /* only call gethrtime() every 100 blocks */ + static int iters; + if (++iters > 100) + iters = 0; + else + return (0); + + if (dump_opt['b'] < 5 && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); char buf[10]; uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize; @@ -2494,6 +2502,14 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) (longlong_t)vd->vdev_ms_count); msp->ms_ops = &zdb_metaslab_ops; + + /* + * We don't want to spend the CPU + * manipulating the size-ordered + * tree, so clear the range_tree + * ops. + */ + msp->ms_tree->rt_ops = NULL; VERIFY0(space_map_load(msp->ms_sm, msp->ms_tree, SM_ALLOC)); msp->ms_loaded = B_TRUE; @@ -3508,6 +3524,13 @@ main(int argc, char **argv) */ zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024; + /* + * "zdb -c" uses checksum-verifying scrub i/os which are async reads. + * "zdb -b" uses traversal prefetch which uses async reads. + * For good performance, let several of them be active at once. + */ + zfs_vdev_async_read_max_active = 10; + kernel_init(FREAD); g_zfs = libzfs_init(); ASSERT(g_zfs != NULL); Modified: projects/routing/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- projects/routing/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Sat Nov 8 18:13:35 2014 (r274298) @@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ const MCAsmMacroParameters &Parameters, const MCAsmMacroArguments &A, const SMLoc &L) { unsigned NParameters = Parameters.size(); - if (NParameters != 0 && NParameters != A.size()) + if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) return Error(L, "Wrong number of arguments"); // A macro without parameters is handled differently on Darwin: @@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ std::size_t End = Body.size(), Pos = 0; for (; Pos != End; ++Pos) { // Check for a substitution or escape. - if (!NParameters) { + if (IsDarwin && !NParameters) { // This macro has no parameters, look for $0, $1, etc. if (Body[Pos] != '$' || Pos + 1 == End) continue; @@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ if (Pos == End) break; - if (!NParameters) { + if (IsDarwin && !NParameters) { switch (Body[Pos + 1]) { // $$ => $ case '$': Copied: projects/routing/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff (from r274297, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/routing/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Sat Nov 8 18:13:35 2014 (r274298, copy of r274297, head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff) @@ -0,0 +1,55 @@ +Pull in r201784 from upstream llvm trunk (by Benjamin Kramer): + + AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets. + + There is code in the wild that relies on $0 not being expanded. + +This fixes some cases of using $ signs in literals being incorrectly +assembled. + +Reported by: Richard Henderson +Upstream PR: http://llvm.org/PR21500 + +Introduced here: http://svnweb.freebsd.org/changeset/base/274286 + +Index: lib/MC/MCParser/AsmParser.cpp +=================================================================== +--- lib/MC/MCParser/AsmParser.cpp ++++ lib/MC/MCParser/AsmParser.cpp +@@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + const MCAsmMacroParameters &Parameters, + const MCAsmMacroArguments &A, const SMLoc &L) { + unsigned NParameters = Parameters.size(); +- if (NParameters != 0 && NParameters != A.size()) ++ if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) + return Error(L, "Wrong number of arguments"); + + // A macro without parameters is handled differently on Darwin: +@@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + std::size_t End = Body.size(), Pos = 0; + for (; Pos != End; ++Pos) { + // Check for a substitution or escape. +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + // This macro has no parameters, look for $0, $1, etc. + if (Body[Pos] != '$' || Pos + 1 == End) + continue; +@@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + if (Pos == End) + break; + +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + switch (Body[Pos + 1]) { + // $$ => $ + case '$': +Index: test/MC/AsmParser/exprs.s +=================================================================== +--- test/MC/AsmParser/exprs.s ++++ test/MC/AsmParser/exprs.s +@@ -1,4 +1,4 @@ +-// RUN: llvm-mc -triple i386-unknown-unknown %s > %t ++// RUN: llvm-mc -triple i386-apple-darwin %s + + .macro check_expr + .if ($0) != ($1) Modified: projects/routing/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c ============================================================================== --- projects/routing/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Sat Nov 8 18:13:35 2014 (r274298) @@ -101,6 +101,13 @@ ATF_TC_BODY(setcontext_link, tc) ucontext_t save; volatile int i = 0; /* avoid longjmp clobbering */ +#ifdef __FreeBSD__ +#ifdef __amd64__ + atf_tc_expect_fail("setcontext in this testcase fails on " + "FreeBSD/amd64 with rc == -1/errno == EINVAL; see PR # 194828"); +#endif +#endif + for (i = 0; i < DEPTH; ++i) { ATF_REQUIRE_EQ(getcontext(&uc[i]), 0); @@ -114,8 +121,15 @@ ATF_TC_BODY(setcontext_link, tc) ATF_REQUIRE_EQ(getcontext(&save), 0); +#ifdef __FreeBSD__ + if (calls == 0) { + int rc = setcontext(&uc[DEPTH-1]); + ATF_REQUIRE_EQ_MSG(rc, 0, "%d != 0; (errno = %d)", rc, errno); + } +#else if (calls == 0) ATF_REQUIRE_EQ(setcontext(&uc[DEPTH-1]), 0); +#endif } ATF_TP_ADD_TCS(tp) Modified: projects/routing/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- projects/routing/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Nov 8 18:13:35 2014 (r274298) @@ -206,9 +206,6 @@ ATF_TC_BODY(mincore_resid, tc) "might be low on memory"); #ifdef __FreeBSD__ - atf_tc_expect_fail("the following calls fail; this seems to be a new " - "issue (didn't occur in 07/2014)"); - ATF_REQUIRE(mlock(addr, npgs * page) == 0); #endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); Modified: projects/routing/contrib/openpam/t/t_openpam_ctype.c ============================================================================== --- projects/routing/contrib/openpam/t/t_openpam_ctype.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/contrib/openpam/t/t_openpam_ctype.c Sat Nov 8 18:13:35 2014 (r274298) @@ -94,7 +94,7 @@ T_OC(pfcs) * Boilerplate */ -const struct t_test *t_plan[] = { +static const struct t_test *t_plan[] = { T(t_oc_digit), T(t_oc_xdigit), T(t_oc_upper), Modified: projects/routing/contrib/openpam/t/t_openpam_readlinev.c ============================================================================== --- projects/routing/contrib/openpam/t/t_openpam_readlinev.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/contrib/openpam/t/t_openpam_readlinev.c Sat Nov 8 18:13:35 2014 (r274298) @@ -255,7 +255,7 @@ T_FUNC(unterminated_line, "unterminated * Boilerplate */ -const struct t_test *t_plan[] = { +static const struct t_test *t_plan[] = { T(empty_input), T(empty_line), T(unterminated_empty_line), Modified: projects/routing/contrib/openpam/t/t_openpam_readword.c ============================================================================== --- projects/routing/contrib/openpam/t/t_openpam_readword.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/contrib/openpam/t/t_openpam_readword.c Sat Nov 8 18:13:35 2014 (r274298) @@ -823,7 +823,7 @@ T_FUNC(escaped_double_quote_within_doubl * Boilerplate */ -const struct t_test *t_plan[] = { +static const struct t_test *t_plan[] = { T(empty_input), T(empty_line), T(single_whitespace), Modified: projects/routing/contrib/tnftp/src/fetch.c ============================================================================== --- projects/routing/contrib/tnftp/src/fetch.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/contrib/tnftp/src/fetch.c Sat Nov 8 18:13:35 2014 (r274298) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: projects/routing/etc/mtree/BSD.tests.dist ============================================================================== --- projects/routing/etc/mtree/BSD.tests.dist Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/etc/mtree/BSD.tests.dist Sat Nov 8 18:13:35 2014 (r274298) @@ -145,6 +145,8 @@ .. libnv .. + libpam + .. libproc .. libutil Modified: projects/routing/etc/periodic/security/Makefile ============================================================================== --- projects/routing/etc/periodic/security/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/etc/periodic/security/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -2,6 +2,8 @@ .include +FILESGROUPS= FILES DATA + FILES= 100.chksetuid \ 110.neggrpperm \ 200.chkmounts \ @@ -10,8 +12,8 @@ FILES= 100.chksetuid \ 410.logincheck \ 700.kernelmsg \ 800.loginfail \ - 900.tcpwrap \ - security.functions + 900.tcpwrap +DATA= security.functions # NB: keep these sorted by MK_* knobs Modified: projects/routing/etc/rc.d/growfs ============================================================================== --- projects/routing/etc/rc.d/growfs Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/etc/rc.d/growfs Sat Nov 8 18:13:35 2014 (r274298) @@ -35,9 +35,7 @@ # and have it work on essentially any size drive. # # TODO: Figure out where this should really be ordered. -# I suspect it should go just after fsck but before mountcritlocal -# but it's hard to tell for sure because of the bug described -# below. +# I suspect it should go just after fsck but before mountcritlocal. # . /etc/rc.subr Modified: projects/routing/gnu/lib/libdialog/Makefile ============================================================================== --- projects/routing/gnu/lib/libdialog/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/gnu/lib/libdialog/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -13,6 +13,9 @@ SRCS= argv.c arrows.c buildlist.c butto INCS= dialog.h dlg_colors.h dlg_config.h dlg_keys.h MAN= dialog.3 +DPADD= ${LIBNCURSESW} ${LIBM} +LDADD= -lncursesw -lm + CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DGCC_UNUSED=__unused .PATH: ${DIALOG} WARNS?= 1 Modified: projects/routing/lib/Makefile ============================================================================== --- projects/routing/lib/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/lib/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -42,12 +42,14 @@ SUBDIR= ${SUBDIR_ORDERED} \ libcrypt \ libdevinfo \ libdevstat \ + libdpv \ libdwarf \ libedit \ ${_libevent} \ libexecinfo \ libexpat \ libfetch \ + libfigpar \ libgeom \ ${_libgpib} \ ${_libgssapi} \ @@ -129,7 +131,7 @@ SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libcapsicum= libnv SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog SUBDIR_DEPEND_libdevstat= libkvm -SUBDIR_DEPEND_libdiaglog= ncurses +SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libg++= msun SUBDIR_DEPEND_libgeom= libexpat libsbuf Modified: projects/routing/lib/libpam/libpam/Makefile ============================================================================== --- projects/routing/lib/libpam/libpam/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/lib/libpam/libpam/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -199,4 +199,8 @@ DPSRCS= openpam_static.c INCS= ${HEADERS} ${ADD_HEADERS} INCSDIR= ${INCLUDEDIR}/security +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: projects/routing/rescue/rescue/Makefile ============================================================================== --- projects/routing/rescue/rescue/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/rescue/rescue/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -52,7 +52,7 @@ CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil +CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil -lxo CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs Modified: projects/routing/sbin/fsirand/Makefile ============================================================================== --- projects/routing/sbin/fsirand/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/sbin/fsirand/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -4,7 +4,5 @@ PROG= fsirand MAN= fsirand.8 WARNS?= 3 -DPADD= ${LIBUTIL} -LDADD= -lutil .include Modified: projects/routing/sbin/ifconfig/ifgre.c ============================================================================== --- projects/routing/sbin/ifconfig/ifgre.c Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/sbin/ifconfig/ifgre.c Sat Nov 8 18:13:35 2014 (r274298) @@ -23,52 +23,50 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif +#include +__FBSDID("$FreeBSD$"); #include #include #include #include - -#include -#include - -#include #include #include -#include #include +#include #include -#include #include -#include +#include #include -#include #include "ifconfig.h" +#define GREBITS "\020\01ENABLE_CSUM\02ENABLE_SEQ" + static void gre_status(int s); static void gre_status(int s) { - int grekey = 0; + uint32_t opts = 0; - ifr.ifr_data = (caddr_t)&grekey; + ifr.ifr_data = (caddr_t)&opts; if (ioctl(s, GREGKEY, &ifr) == 0) - if (grekey != 0) - printf("\tgrekey: %d\n", grekey); + if (opts != 0) + printf("\tgrekey: 0x%x (%u)\n", opts, opts); + opts = 0; + if (ioctl(s, GREGOPTS, &ifr) != 0 || opts == 0) + return; + printb("\toptions", opts, GREBITS); + putchar('\n'); } static void setifgrekey(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - uint32_t grekey = atol(val); + uint32_t grekey = strtol(val, NULL, 0); strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_data = (caddr_t)&grekey; @@ -76,8 +74,35 @@ setifgrekey(const char *val, int dummy _ warn("ioctl (set grekey)"); } +static void +setifgreopts(const char *val, int d, int s, const struct afswtch *afp) +{ + uint32_t opts; + + ifr.ifr_data = (caddr_t)&opts; + if (ioctl(s, GREGOPTS, &ifr) == -1) { + warn("ioctl(GREGOPTS)"); + return; + } + + if (d < 0) + opts &= ~(-d); + else + opts |= d; + + if (ioctl(s, GRESOPTS, &ifr) == -1) { + warn("ioctl(GIFSOPTS)"); + return; + } +} + + static struct cmd gre_cmds[] = { DEF_CMD_ARG("grekey", setifgrekey), + DEF_CMD("enable_csum", GRE_ENABLE_CSUM, setifgreopts), + DEF_CMD("-enable_csum",-GRE_ENABLE_CSUM,setifgreopts), + DEF_CMD("enable_seq", GRE_ENABLE_SEQ, setifgreopts), + DEF_CMD("-enable_seq",-GRE_ENABLE_SEQ, setifgreopts), }; static struct afswtch af_gre = { .af_name = "af_gre", Modified: projects/routing/share/man/man4/Makefile ============================================================================== --- projects/routing/share/man/man4/Makefile Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/share/man/man4/Makefile Sat Nov 8 18:13:35 2014 (r274298) @@ -252,6 +252,7 @@ MAN= aac.4 \ malo.4 \ mcd.4 \ md.4 \ + me.4 \ mem.4 \ meteor.4 \ mfi.4 \ Modified: projects/routing/share/man/man4/gre.4 ============================================================================== --- projects/routing/share/man/man4/gre.4 Sat Nov 8 16:52:07 2014 (r274297) +++ projects/routing/share/man/man4/gre.4 Sat Nov 8 18:13:35 2014 (r274298) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2008 +.Dd November 7, 2014 .Dt GRE 4 .Os .Sh NAME @@ -68,162 +68,30 @@ and .Cm destroy subcommands. .Pp -This driver currently supports the following modes of operation: -.Bl -tag -width indent -.It "GRE encapsulation (IP protocol number 47)" -Encapsulated datagrams are -prepended an outer datagram and a GRE header. +This driver corresponds to RFC 2784. +Encapsulated datagrams are prepended an outer datagram and a GRE header. The GRE header specifies the type of the encapsulated datagram and thus allows for tunneling other protocols than IP. GRE mode is also the default tunnel mode on Cisco routers. -This is also the default mode of operation of the -.Nm -interfaces. -As part of the GRE mode, .Nm also supports Cisco WCCP protocol, both version 1 and version 2. -Since there is no reliable way to distinguish between WCCP versions, it -should be configured manually using the -.Cm link2 -flag. -If the -.Cm link2 -flag is not set (default), then WCCP version 1 is selected. -.It "MOBILE encapsulation (IP protocol number 55)" -Datagrams are *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***