From owner-p4-projects@FreeBSD.ORG Sat Feb 10 03:57:46 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4ED7616A407; Sat, 10 Feb 2007 03:57:46 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E14DB16A400 for ; Sat, 10 Feb 2007 03:57:45 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id D1D2813C441 for ; Sat, 10 Feb 2007 03:57:45 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1A3vjtV031567 for ; Sat, 10 Feb 2007 03:57:45 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1A3vhxi031563 for perforce@freebsd.org; Sat, 10 Feb 2007 03:57:43 GMT (envelope-from mjacob@freebsd.org) Date: Sat, 10 Feb 2007 03:57:43 GMT Message-Id: <200702100357.l1A3vhxi031563@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 114338 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Feb 2007 03:57:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=114338 Change 114338 by mjacob@mjexp on 2007/02/10 03:56:54 IFC Affected files ... .. //depot/projects/mjexp/UPDATING#5 integrate .. //depot/projects/mjexp/etc/defaults/rc.conf#5 integrate .. //depot/projects/mjexp/etc/network.subr#4 integrate .. //depot/projects/mjexp/etc/periodic/security/800.loginfail#2 integrate .. //depot/projects/mjexp/etc/rc.d/netif#3 integrate .. //depot/projects/mjexp/lib/libarchive/archive_read.c#7 integrate .. //depot/projects/mjexp/lib/libarchive/archive_read_support_compression_none.c#6 integrate .. //depot/projects/mjexp/lib/libkvm/kvm_getswapinfo.c#2 integrate .. //depot/projects/mjexp/libexec/ftpd/ftpd.c#2 integrate .. //depot/projects/mjexp/release/doc/de_DE.ISO8859-1/installation/common/install.sgml#2 integrate .. //depot/projects/mjexp/release/doc/en_US.ISO8859-1/installation/common/install.sgml#2 integrate .. //depot/projects/mjexp/release/doc/fr_FR.ISO8859-1/installation/common/install.sgml#2 integrate .. //depot/projects/mjexp/release/doc/ru_RU.KOI8-R/installation/common/install.sgml#2 integrate .. //depot/projects/mjexp/release/doc/zh_CN.GB2312/installation/common/install.sgml#3 integrate .. //depot/projects/mjexp/sbin/dhclient/clparse.c#2 integrate .. //depot/projects/mjexp/sbin/dhclient/dhclient-script#2 integrate .. //depot/projects/mjexp/sbin/dhclient/dhclient.c#3 integrate .. //depot/projects/mjexp/sbin/dhclient/dhclient.conf#2 integrate .. //depot/projects/mjexp/sbin/dhclient/dhcp.h#2 integrate .. //depot/projects/mjexp/sbin/dhclient/tables.c#2 integrate .. //depot/projects/mjexp/sbin/ifconfig/ifconfig.8#7 integrate .. //depot/projects/mjexp/sbin/mount/mount.c#5 integrate .. //depot/projects/mjexp/share/man/man4/ata.4#4 integrate .. //depot/projects/mjexp/share/man/man4/bce.4#5 integrate .. //depot/projects/mjexp/share/man/man4/enc.4#2 integrate .. //depot/projects/mjexp/share/man/man4/icmp.4#2 integrate .. //depot/projects/mjexp/share/man/man4/joy.4#3 integrate .. //depot/projects/mjexp/share/man/man4/man4.i386/fe.4#2 integrate .. //depot/projects/mjexp/share/man/man4/ng_bt3c.4#2 integrate .. //depot/projects/mjexp/share/man/man4/tun.4#4 integrate .. //depot/projects/mjexp/share/man/man4/uark.4#2 integrate .. //depot/projects/mjexp/share/man/man4/ubsa.4#3 integrate .. //depot/projects/mjexp/share/man/man5/linsysfs.5#4 integrate .. //depot/projects/mjexp/share/man/man5/rc.conf.5#7 integrate .. //depot/projects/mjexp/share/man/man9/device_set_driver.9#2 integrate .. //depot/projects/mjexp/share/man/man9/firmware.9#2 integrate .. //depot/projects/mjexp/share/man/man9/ieee80211_ioctl.9#2 integrate .. //depot/projects/mjexp/share/syscons/keymaps/hr.iso.kbd#2 integrate .. //depot/projects/mjexp/sys/amd64/amd64/mp_machdep.c#5 integrate .. //depot/projects/mjexp/sys/amd64/conf/GENERIC#7 integrate .. //depot/projects/mjexp/sys/amd64/include/gdb_machdep.h#2 integrate .. //depot/projects/mjexp/sys/amd64/include/pcpu.h#2 integrate .. //depot/projects/mjexp/sys/arm/arm/pmap.c#4 integrate .. //depot/projects/mjexp/sys/arm/at91/at91_twi.c#5 integrate .. //depot/projects/mjexp/sys/arm/at91/if_ate.c#6 integrate .. //depot/projects/mjexp/sys/arm/conf/EP80219#3 integrate .. //depot/projects/mjexp/sys/conf/NOTES#11 integrate .. //depot/projects/mjexp/sys/conf/files#11 integrate .. //depot/projects/mjexp/sys/conf/files.powerpc#4 integrate .. //depot/projects/mjexp/sys/conf/options#10 integrate .. //depot/projects/mjexp/sys/dev/isp/isp_pci.c#10 integrate .. //depot/projects/mjexp/sys/dev/mii/rlphy.c#6 integrate .. //depot/projects/mjexp/sys/dev/pci/pci.c#9 integrate .. //depot/projects/mjexp/sys/dev/usb/ubsa.c#4 integrate .. //depot/projects/mjexp/sys/dev/usb/usbdevs#6 integrate .. //depot/projects/mjexp/sys/fs/cd9660/TODO#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/TODO.hibler#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_bmap.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_iconv.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_lookup.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_mount.h#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_node.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_node.h#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_rrip.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_rrip.h#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_util.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_vfsops.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/cd9660_vnops.c#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/iso.h#1 branch .. //depot/projects/mjexp/sys/fs/cd9660/iso_rrip.h#1 branch .. //depot/projects/mjexp/sys/fs/msdosfs/msdosfs_vfsops.c#6 integrate .. //depot/projects/mjexp/sys/fs/procfs/procfs.c#2 integrate .. //depot/projects/mjexp/sys/geom/geom_apple.c#2 delete .. //depot/projects/mjexp/sys/geom/geom_gpt.c#3 delete .. //depot/projects/mjexp/sys/geom/part/g_part.c#1 branch .. //depot/projects/mjexp/sys/geom/part/g_part.h#1 branch .. //depot/projects/mjexp/sys/geom/part/g_part_apm.c#1 branch .. //depot/projects/mjexp/sys/geom/part/g_part_gpt.c#1 branch .. //depot/projects/mjexp/sys/geom/part/g_part_if.m#1 branch .. //depot/projects/mjexp/sys/i386/conf/GENERIC#5 integrate .. //depot/projects/mjexp/sys/i386/i386/mp_machdep.c#5 integrate .. //depot/projects/mjexp/sys/i386/include/pcpu.h#2 integrate .. //depot/projects/mjexp/sys/ia64/conf/DEFAULTS#4 integrate .. //depot/projects/mjexp/sys/ia64/conf/GENERIC#4 integrate .. //depot/projects/mjexp/sys/kern/kern_sig.c#8 integrate .. //depot/projects/mjexp/sys/kern/kern_switch.c#6 integrate .. //depot/projects/mjexp/sys/kern/sched_ule.c#10 integrate .. //depot/projects/mjexp/sys/kern/subr_witness.c#5 integrate .. //depot/projects/mjexp/sys/kern/uipc_usrreq.c#5 integrate .. //depot/projects/mjexp/sys/modules/geom/Makefile#5 integrate .. //depot/projects/mjexp/sys/modules/ip_mroute_mod/Makefile#2 integrate .. //depot/projects/mjexp/sys/net/if_loop.c#2 integrate .. //depot/projects/mjexp/sys/net/if_tap.c#4 integrate .. //depot/projects/mjexp/sys/net/if_tun.c#5 integrate .. //depot/projects/mjexp/sys/netgraph/ng_ksocket.c#2 integrate .. //depot/projects/mjexp/sys/netinet/ip_mroute.c#4 integrate .. //depot/projects/mjexp/sys/netinet/ip_mroute.h#2 integrate .. //depot/projects/mjexp/sys/netinet6/ah_core.c#2 integrate .. //depot/projects/mjexp/sys/netsmb/smb_dev.c#2 integrate .. //depot/projects/mjexp/sys/pc98/conf/GENERIC#4 integrate .. //depot/projects/mjexp/sys/powerpc/conf/DEFAULTS#4 integrate .. //depot/projects/mjexp/sys/powerpc/conf/GENERIC#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_framework.h#5 integrate .. //depot/projects/mjexp/sys/security/mac/mac_inet.c#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_internal.h#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_label.c#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_pipe.c#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_policy.h#2 integrate .. //depot/projects/mjexp/sys/security/mac/mac_posix_sem.c#5 integrate .. //depot/projects/mjexp/sys/security/mac/mac_system.c#5 integrate .. //depot/projects/mjexp/sys/security/mac/mac_sysv_msg.c#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_sysv_sem.c#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_sysv_shm.c#4 integrate .. //depot/projects/mjexp/sys/security/mac/mac_vfs.c#4 integrate .. //depot/projects/mjexp/sys/security/mac_biba/mac_biba.c#4 integrate .. //depot/projects/mjexp/sys/security/mac_bsdextended/mac_bsdextended.c#4 integrate .. //depot/projects/mjexp/sys/security/mac_ifoff/mac_ifoff.c#3 integrate .. //depot/projects/mjexp/sys/security/mac_lomac/mac_lomac.c#5 integrate .. //depot/projects/mjexp/sys/security/mac_mls/mac_mls.c#4 integrate .. //depot/projects/mjexp/sys/security/mac_none/mac_none.c#3 integrate .. //depot/projects/mjexp/sys/security/mac_partition/mac_partition.c#4 integrate .. //depot/projects/mjexp/sys/security/mac_portacl/mac_portacl.c#5 integrate .. //depot/projects/mjexp/sys/security/mac_seeotheruids/mac_seeotheruids.c#4 integrate .. //depot/projects/mjexp/sys/security/mac_stub/mac_stub.c#5 integrate .. //depot/projects/mjexp/sys/security/mac_test/mac_test.c#4 integrate .. //depot/projects/mjexp/sys/sparc64/conf/GENERIC#4 integrate .. //depot/projects/mjexp/sys/sun4v/conf/GENERIC#4 integrate .. //depot/projects/mjexp/sys/sys/_label.h#2 delete .. //depot/projects/mjexp/sys/sys/apm.h#1 branch .. //depot/projects/mjexp/sys/sys/mac.h#3 integrate .. //depot/projects/mjexp/sys/sys/param.h#8 integrate .. //depot/projects/mjexp/sys/sys/runq.h#4 integrate .. //depot/projects/mjexp/sys/ufs/ufs/ufs_vnops.c#6 integrate .. //depot/projects/mjexp/sys/vm/swap_pager.c#5 integrate .. //depot/projects/mjexp/sys/vm/swap_pager.h#2 integrate .. //depot/projects/mjexp/sys/vm/vm_contig.c#5 integrate .. //depot/projects/mjexp/sys/vm/vm_page.c#5 integrate .. //depot/projects/mjexp/sys/vm/vm_pageout.c#4 integrate .. //depot/projects/mjexp/sys/vm/vm_pageq.c#2 integrate .. //depot/projects/mjexp/sys/vm/vm_zeroidle.c#5 integrate .. //depot/projects/mjexp/tools/tools/netrate/netsend/netsend.c#2 integrate .. //depot/projects/mjexp/tools/tools/umastat/umastat.c#2 integrate .. //depot/projects/mjexp/usr.bin/ctags/C.c#2 integrate .. //depot/projects/mjexp/usr.bin/ctags/fortran.c#2 integrate .. //depot/projects/mjexp/usr.bin/ctags/tree.c#2 integrate .. //depot/projects/mjexp/usr.bin/getent/getent.c#2 integrate .. //depot/projects/mjexp/usr.bin/mklocale/yacc.y#2 integrate .. //depot/projects/mjexp/usr.bin/ncplist/ncplist.c#2 integrate .. //depot/projects/mjexp/usr.bin/ncplogin/ncplogin.c#2 integrate .. //depot/projects/mjexp/usr.bin/tar/write.c#4 integrate .. //depot/projects/mjexp/usr.sbin/apmd/apmd.c#2 integrate .. //depot/projects/mjexp/usr.sbin/apmd/contrib/pccardq.c#2 integrate .. //depot/projects/mjexp/usr.sbin/iostat/iostat.c#2 integrate .. //depot/projects/mjexp/usr.sbin/ngctl/dot.c#2 integrate .. //depot/projects/mjexp/usr.sbin/ngctl/list.c#2 integrate .. //depot/projects/mjexp/usr.sbin/ngctl/main.c#2 integrate .. //depot/projects/mjexp/usr.sbin/ngctl/show.c#2 integrate .. //depot/projects/mjexp/usr.sbin/pciconf/pciconf.8#3 integrate .. //depot/projects/mjexp/usr.sbin/pkg_install/info/show.c#2 integrate .. //depot/projects/mjexp/usr.sbin/setfmac/setfmac.c#2 integrate Differences ... ==== //depot/projects/mjexp/UPDATING#5 (text+ko) ==== @@ -21,6 +21,15 @@ developers choose to disable these features on build machines to maximize performance. +20070207: + Support for IPIP tunnels (VIFF_TUNNEL) in IPv4 multicast routing + has been removed. Its functionality may be achieved by explicitly + configuring gif(4) interfaces and using the 'phyint' keyword in + mrouted.conf. + XORP does not support source-routed IPv4 multicast tunnels nor the + integrated IPIP tunneling, therefore it is not affected by this + change. The __FreeBSD_version macro has been bumped to 700030. + 20061221: Support for PCI Message Signalled Interrupts has been re-enabled in the bge driver, only for those chips which are @@ -703,4 +712,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.470 2006/12/22 03:03:31 jdp Exp $ +$FreeBSD: src/UPDATING,v 1.471 2007/02/07 16:04:11 bms Exp $ ==== //depot/projects/mjexp/etc/defaults/rc.conf#5 (text+ko) ==== @@ -15,7 +15,7 @@ # For a more detailed explanation of all the rc.conf variables, please # refer to the rc.conf(5) manual page. # -# $FreeBSD: src/etc/defaults/rc.conf,v 1.303 2007/01/20 04:24:19 mpp Exp $ +# $FreeBSD: src/etc/defaults/rc.conf,v 1.304 2007/02/09 12:11:27 flz Exp $ ############################################################## ### Important initial Boot-time options #################### @@ -178,11 +178,15 @@ sppp_interfaces="" # List of sppp interfaces. #sppp_interfaces="isp0" # example: sppp over ISDN #spppconfig_isp0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'" -gif_interfaces="NO" # List of GIF tunnels (or "NO"). +gif_interfaces="" # List of GIF tunnels. #gif_interfaces="gif0 gif1" # Examples typically for a router. # Choose correct tunnel addrs. #gifconfig_gif0="10.1.1.1 10.1.2.1" # Examples typically for a router. #gifconfig_gif1="10.1.1.2 10.1.2.2" # Examples typically for a router. +fec_interfaces="" # List of Fast EtherChannels. +#fec_interfaces="fec0 fec1" +#fecconfig_fec0="fxp0 dc0" # Examples typically for two NICs +#fecconfig_fec1="em0 em1 bge0 bge1" # Examples typically for four NICs # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). ==== //depot/projects/mjexp/etc/network.subr#4 (text+ko) ==== @@ -22,7 +22,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/etc/network.subr,v 1.176 2006/10/29 13:29:49 mlaier Exp $ +# $FreeBSD: src/etc/network.subr,v 1.177 2007/02/09 12:11:26 flz Exp $ # # @@ -455,26 +455,89 @@ debug "Destroyed clones: ${_list}" } +# Create netgraph nodes. +# +ng_mkpeer() { + ngctl -f - 2> /dev/null </dev/null 2>&1 + ifconfig $i tunnel ${peers} + ifconfig $i up + ;; + esac + done +} + +# ng_fec_create ifn +# Configure Fast EtherChannel for interface $ifn. Returns 0 if FEC +# arguments were found and configured; returns !0 otherwise. +ng_fec_create() { + local req_iface iface bogus + req_iface="$1" + + ngctl shutdown ${req_iface}: > /dev/null 2>&1 + + bogus="" + while true; do + iface=`ng_create_one fec dummy fec` + if [ -z "${iface}" ]; then + exit 2 + fi + if [ "${iface}" = "${req_iface}" ]; then + break + fi + bogus="${bogus} ${iface}" + done + + for iface in ${bogus}; do + ngctl shutdown ${iface}: + done +} + +fec_up() { + for i in ${fec_interfaces}; do + ng_fec_create $i + for j in `get_if_var $i fecconfig_IF`; do + case ${j} in '') continue ;; *) - ifconfig $i create >/dev/null 2>&1 - ifconfig $i tunnel ${peers} - ifconfig $i up + ngctl msg ${i}: add_iface "\"${j}\"" ;; esac done - ;; - esac + done } # ==== //depot/projects/mjexp/etc/periodic/security/800.loginfail#2 (text+ko) ==== @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.6 2006/03/05 15:45:38 matteo Exp $ +# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.7 2007/02/05 16:36:25 jdp Exp $ # # Show login failures @@ -59,7 +59,7 @@ [Yy][Ee][Ss]) echo "" echo "${host} login failures:" - n=$(catmsgs | grep -ia "^$yesterday.*(fail|invalid|bad|illegal)" | + n=$(catmsgs | egrep -ia "^$yesterday.*(fail|invalid|bad|illegal)" | tee /dev/stderr | wc -l) [ $n -gt 0 ] && rc=1 || rc=0;; *) rc=0;; ==== //depot/projects/mjexp/etc/rc.d/netif#3 (text+ko) ==== @@ -22,7 +22,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# $FreeBSD: src/etc/rc.d/netif,v 1.21 2006/12/30 22:53:20 yar Exp $ +# $FreeBSD: src/etc/rc.d/netif,v 1.22 2007/02/09 12:11:26 flz Exp $ # # PROVIDE: netif @@ -57,6 +57,9 @@ # Create cloned interfaces clone_up + # Create Fast EtherChannel interfaces + fec_up + # Create IPv6<-->IPv4 tunnels gif_up ==== //depot/projects/mjexp/lib/libarchive/archive_read.c#7 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.28 2007/02/01 06:18:16 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.29 2007/02/05 16:30:40 cperciva Exp $"); #ifdef HAVE_ERRNO_H #include @@ -65,10 +65,8 @@ unsigned char *nulls; a = (struct archive *)malloc(sizeof(*a)); - if (a == NULL) { - archive_set_error(a, ENOMEM, "Can't allocate archive object"); + if (a == NULL) return (NULL); - } memset(a, 0, sizeof(*a)); a->user_uid = geteuid(); ==== //depot/projects/mjexp/lib/libarchive/archive_read_support_compression_none.c#6 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.13 2007/01/09 08:05:55 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.14 2007/02/05 16:30:40 cperciva Exp $"); #include #ifdef HAVE_ERRNO_H @@ -301,7 +301,11 @@ /* * If a client_skipper was provided, try that first. */ +#if ARCHIVE_API_VERSION < 2 if ((a->client_skipper != NULL) && (request < SSIZE_MAX)) { +#else + if (a->client_skipper != NULL) { +#endif bytes_skipped = (a->client_skipper)(a, a->client_data, request); if (bytes_skipped < 0) { /* error */ @@ -333,7 +337,8 @@ if (bytes_read == 0) { /* We hit EOF before we satisfied the skip request. */ archive_set_error(a, ARCHIVE_ERRNO_MISC, - "Truncated input file (need to skip %d bytes)", (int)request); + "Truncated input file (need to skip %jd bytes)", + (intmax_t)request); return (ARCHIVE_FATAL); } assert(bytes_read >= 0); /* precondition for cast below */ ==== //depot/projects/mjexp/lib/libkvm/kvm_getswapinfo.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libkvm/kvm_getswapinfo.c,v 1.26 2004/07/31 18:49:53 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libkvm/kvm_getswapinfo.c,v 1.27 2007/02/07 17:43:10 jhb Exp $"); #include #include @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -49,18 +50,34 @@ #include "kvm_private.h" -#define NL_SWAPBLIST 0 -#define NL_SWDEVT 1 -#define NL_NSWDEV 2 -#define NL_DMMAX 3 +static struct nlist kvm_swap_nl[] = { + { "_swtailq" }, /* list of swap devices and sizes */ + { "_dmmax" }, /* maximum size of a swap block */ + { NULL } +}; + +#define NL_SWTAILQ 0 +#define NL_DMMAX 1 static int kvm_swap_nl_cached = 0; static int unswdev; /* number of found swap dev's */ static int dmmax; +static int kvm_getswapinfo_kvm(kvm_t *, struct kvm_swap *, int, int); static int kvm_getswapinfo_sysctl(kvm_t *, struct kvm_swap *, int, int); +static int nlist_init(kvm_t *); static int getsysctl(kvm_t *, char *, void *, size_t); +#define KREAD(kd, addr, obj) \ + (kvm_read(kd, addr, (char *)(obj), sizeof(*obj)) != sizeof(*obj)) +#define KGET(idx, var) \ + KGET2(kvm_swap_nl[(idx)].n_value, var, kvm_swap_nl[(idx)].n_name) +#define KGET2(addr, var, msg) \ + if (KREAD(kd, (u_long)(addr), (var))) { \ + _kvm_err(kd, kd->program, "cannot read %s", msg); \ + return (-1); \ + } + #define GETSWDEVNAME(dev, str, flags) \ if (dev == NODEV) { \ strlcpy(str, "[NFS swap]", sizeof(str)); \ @@ -91,8 +108,50 @@ if (ISALIVE(kd)) { return kvm_getswapinfo_sysctl(kd, swap_ary, swap_max, flags); } else { - return -1; + return kvm_getswapinfo_kvm(kd, swap_ary, swap_max, flags); + } +} + +int +kvm_getswapinfo_kvm( + kvm_t *kd, + struct kvm_swap *swap_ary, + int swap_max, + int flags +) { + int i, ttl; + TAILQ_HEAD(, swdevt) swtailq; + struct swdevt *sp, swinfo; + struct kvm_swap tot; + + if (!nlist_init(kd)) + return (-1); + + bzero(&tot, sizeof(tot)); + KGET(NL_SWTAILQ, &swtailq); + sp = TAILQ_FIRST(&swtailq); + for (i = 0; sp != NULL; i++) { + KGET2(sp, &swinfo, "swinfo"); + ttl = swinfo.sw_nblks - dmmax; + if (i < swap_max - 1) { + bzero(&swap_ary[i], sizeof(swap_ary[i])); + swap_ary[i].ksw_total = ttl; + swap_ary[i].ksw_used = swinfo.sw_used; + swap_ary[i].ksw_flags = swinfo.sw_flags; + GETSWDEVNAME(swinfo.sw_dev, swap_ary[i].ksw_devname, + flags); + } + tot.ksw_total += ttl; + tot.ksw_used += swinfo.sw_used; + sp = TAILQ_NEXT(&swinfo, sw_list); } + + if (i >= swap_max) + i = swap_max - 1; + if (i >= 0) + swap_ary[i] = tot; + + return(i); } #define GETSYSCTL(kd, name, var) \ @@ -168,6 +227,36 @@ } static int +nlist_init(kvm_t *kd) +{ + TAILQ_HEAD(, swdevt) swtailq; + struct swdevt *sp, swinfo; + + if (kvm_swap_nl_cached) + return (1); + + if (kvm_nlist(kd, kvm_swap_nl) < 0) + return (0); + + /* Required entries */ + if (kvm_swap_nl[NL_SWTAILQ].n_value == 0) { + _kvm_err(kd, kd->program, "unable to find swtailq"); + return (0); + } + + if (kvm_swap_nl[NL_DMMAX].n_value == 0) { + _kvm_err(kd, kd->program, "unable to find dmmax"); + return (0); + } + + /* Get globals, type of swap */ + KGET(NL_DMMAX, &dmmax); + + kvm_swap_nl_cached = 1; + return (1); +} + +static int getsysctl ( kvm_t *kd, char *name, ==== //depot/projects/mjexp/libexec/ftpd/ftpd.c#2 (text+ko) ==== @@ -46,7 +46,7 @@ #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.210 2006/03/01 16:13:17 ume Exp $"); +__FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.211 2007/02/09 17:18:39 yar Exp $"); /* * FTP server. @@ -1871,20 +1871,12 @@ #ifdef TCP_NOPUSH /* * Turn off push flag to keep sender TCP from sending short packets - * at the boundaries of each write(). Should probably do a SO_SNDBUF - * to set the send buffer size as well, but that may not be desirable - * in heavy-load situations. + * at the boundaries of each write(). */ on = 1; if (setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, &on, sizeof on) < 0) syslog(LOG_WARNING, "data setsockopt (TCP_NOPUSH): %m"); #endif -#ifdef SO_SNDBUF - on = 65536; - if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, &on, sizeof on) < 0) - syslog(LOG_WARNING, "data setsockopt (SO_SNDBUF): %m"); -#endif - return (fdopen(s, mode)); bad: /* Return the real value of errno (close may change it) */ ==== //depot/projects/mjexp/release/doc/de_DE.ISO8859-1/installation/common/install.sgml#2 (text+ko) ==== @@ -1,6 +1,6 @@