From owner-p4-projects@FreeBSD.ORG Sat Aug 4 19:08:10 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8F7BF16A41B; Sat, 4 Aug 2007 19:08:10 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 257A216A41A for ; Sat, 4 Aug 2007 19:08:10 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2161A13C459 for ; Sat, 4 Aug 2007 19:08:10 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l74J89Jg054249 for ; Sat, 4 Aug 2007 19:08:09 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l74J87s0054246 for perforce@freebsd.org; Sat, 4 Aug 2007 19:08:07 GMT (envelope-from imp@freebsd.org) Date: Sat, 4 Aug 2007 19:08:07 GMT Message-Id: <200708041908.l74J87s0054246@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 124682 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, 04 Aug 2007 19:08:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=124682 Change 124682 by imp@imp_paco-paco on 2007/08/04 19:07:31 IFC @124679 Affected files ... .. //depot/projects/arm/src/ObsoleteFiles.inc#25 integrate .. //depot/projects/arm/src/contrib/less/main.c#7 integrate .. //depot/projects/arm/src/contrib/tcpdump/print-bgp.c#2 integrate .. //depot/projects/arm/src/etc/namedb/named.conf#3 integrate .. //depot/projects/arm/src/etc/rc.d/nscd#1 branch .. //depot/projects/arm/src/include/arpa/tftp.h#2 integrate .. //depot/projects/arm/src/lib/libarchive/test/main.c#6 integrate .. //depot/projects/arm/src/lib/libc/net/name6.c#3 integrate .. //depot/projects/arm/src/lib/libelf/elf_begin.3#2 integrate .. //depot/projects/arm/src/lib/libelf/elf_memory.3#2 integrate .. //depot/projects/arm/src/lib/libutil/flopen.3#2 integrate .. //depot/projects/arm/src/lib/libutil/flopen.c#3 integrate .. //depot/projects/arm/src/lib/libutil/pidfile.c#3 integrate .. //depot/projects/arm/src/release/doc/en_US.ISO8859-1/relnotes/article.sgml#18 integrate .. //depot/projects/arm/src/sbin/ifconfig/ifbridge.c#7 integrate .. //depot/projects/arm/src/sbin/ifconfig/ifconfig.8#17 integrate .. //depot/projects/arm/src/share/man/man4/Makefile#17 integrate .. //depot/projects/arm/src/share/man/man4/crypto.4#2 integrate .. //depot/projects/arm/src/share/man/man4/enc.4#4 integrate .. //depot/projects/arm/src/share/man/man4/fast_ipsec.4#5 delete .. //depot/projects/arm/src/share/man/man4/ipsec.4#4 integrate .. //depot/projects/arm/src/share/man/man4/lagg.4#2 integrate .. //depot/projects/arm/src/share/man/man4/man4.i386/padlock.4#5 integrate .. //depot/projects/arm/src/share/man/man4/ng_ppp.4#3 integrate .. //depot/projects/arm/src/share/man/man9/sysctl_ctx_init.9#2 integrate .. //depot/projects/arm/src/share/misc/committers-doc.dot#3 integrate .. //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#21 integrate .. //depot/projects/arm/src/sys/amd64/amd64/mp_machdep.c#18 integrate .. //depot/projects/arm/src/sys/arm/arm/trap.c#16 integrate .. //depot/projects/arm/src/sys/arm/at91/at91rm92reg.h#21 integrate .. //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#44 integrate .. //depot/projects/arm/src/sys/arm/at91/ohci_atmelarm.c#15 integrate .. //depot/projects/arm/src/sys/arm/conf/KB920X#45 integrate .. //depot/projects/arm/src/sys/conf/kern.pre.mk#12 integrate .. //depot/projects/arm/src/sys/conf/options.ia64#3 integrate .. //depot/projects/arm/src/sys/contrib/pf/net/if_pfsync.c#11 integrate .. //depot/projects/arm/src/sys/dev/acpica/acpi_hpet.c#8 integrate .. //depot/projects/arm/src/sys/dev/acpica/acpi_timer.c#6 integrate .. //depot/projects/arm/src/sys/dev/adlink/adlink.c#5 integrate .. //depot/projects/arm/src/sys/dev/aic7xxx/aic7xxx.c#5 integrate .. //depot/projects/arm/src/sys/dev/aic7xxx/aic_osm_lib.c#3 integrate .. //depot/projects/arm/src/sys/dev/an/if_an.c#8 integrate .. //depot/projects/arm/src/sys/dev/arcmsr/arcmsr.c#13 integrate .. //depot/projects/arm/src/sys/dev/bce/if_bce.c#21 integrate .. //depot/projects/arm/src/sys/dev/bce/if_bcefw.h#4 integrate .. //depot/projects/arm/src/sys/dev/bce/if_bcereg.h#11 integrate .. //depot/projects/arm/src/sys/dev/nmdm/nmdm.c#5 integrate .. //depot/projects/arm/src/sys/dev/pci/pci.c#29 integrate .. //depot/projects/arm/src/sys/dev/usb/umodem.c#7 integrate .. //depot/projects/arm/src/sys/fs/msdosfs/msdosfs_fat.c#4 integrate .. //depot/projects/arm/src/sys/fs/msdosfs/msdosfs_vfsops.c#18 integrate .. //depot/projects/arm/src/sys/fs/tmpfs/tmpfs.h#4 integrate .. //depot/projects/arm/src/sys/fs/tmpfs/tmpfs_subr.c#4 integrate .. //depot/projects/arm/src/sys/i386/i386/local_apic.c#20 integrate .. //depot/projects/arm/src/sys/i386/i386/mp_machdep.c#18 integrate .. //depot/projects/arm/src/sys/ia64/ia64/db_machdep.c#4 integrate .. //depot/projects/arm/src/sys/ia64/ia64/exception.S#4 integrate .. //depot/projects/arm/src/sys/ia64/ia64/interrupt.c#8 integrate .. //depot/projects/arm/src/sys/ia64/ia64/machdep.c#17 integrate .. //depot/projects/arm/src/sys/ia64/ia64/mp_machdep.c#9 integrate .. //depot/projects/arm/src/sys/ia64/ia64/nexus.c#8 integrate .. //depot/projects/arm/src/sys/ia64/ia64/pmap.c#15 integrate .. //depot/projects/arm/src/sys/ia64/ia64/sapic.c#2 integrate .. //depot/projects/arm/src/sys/ia64/include/atomic.h#3 integrate .. //depot/projects/arm/src/sys/ia64/include/intr.h#3 integrate .. //depot/projects/arm/src/sys/ia64/include/md_var.h#4 integrate .. //depot/projects/arm/src/sys/ia64/include/sapicvar.h#2 integrate .. //depot/projects/arm/src/sys/kern/kern_switch.c#15 integrate .. //depot/projects/arm/src/sys/kern/sched_ule.c#22 integrate .. //depot/projects/arm/src/sys/net/bpf.c#19 integrate .. //depot/projects/arm/src/sys/net/if_bridge.c#35 integrate .. //depot/projects/arm/src/sys/net/if_bridgevar.h#15 integrate .. //depot/projects/arm/src/sys/net/if_lagg.c#8 integrate .. //depot/projects/arm/src/sys/net/if_lagg.h#7 integrate .. //depot/projects/arm/src/sys/netgraph/netgraph.h#7 integrate .. //depot/projects/arm/src/sys/netgraph/ng_ppp.c#7 integrate .. //depot/projects/arm/src/sys/netgraph/ng_ppp.h#3 integrate .. //depot/projects/arm/src/sys/netinet/ip_carp.c#14 integrate .. //depot/projects/arm/src/sys/netinet/ip_dummynet.c#12 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw2.c#34 integrate .. //depot/projects/arm/src/sys/netinet/ip_mroute.c#14 integrate .. //depot/projects/arm/src/sys/netinet/tcp_fsm.h#3 integrate .. //depot/projects/arm/src/sys/netinet/tcp_input.c#35 integrate .. //depot/projects/arm/src/sys/netinet/tcp_subr.c#30 integrate .. //depot/projects/arm/src/sys/netinet/tcp_syncache.c#25 integrate .. //depot/projects/arm/src/sys/netinet/tcp_timer.h#9 integrate .. //depot/projects/arm/src/sys/netinet/tcp_usrreq.c#21 integrate .. //depot/projects/arm/src/sys/netinet/tcp_var.h#22 integrate .. //depot/projects/arm/src/sys/netipx/spx_debug.c#4 integrate .. //depot/projects/arm/src/sys/netipx/spx_debug.h#4 integrate .. //depot/projects/arm/src/sys/pc98/cbus/clock.c#8 integrate .. //depot/projects/arm/src/sys/pci/viapm.c#8 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/trap.c#10 integrate .. //depot/projects/arm/src/sys/sys/mutex.h#18 integrate .. //depot/projects/arm/src/sys/sys/vmmeter.h#6 integrate .. //depot/projects/arm/src/sys/vm/vm_meter.c#11 integrate .. //depot/projects/arm/src/sys/vm/vm_page.c#30 integrate .. //depot/projects/arm/src/tools/regression/lib/libutil/Makefile#2 integrate .. //depot/projects/arm/src/tools/regression/lib/libutil/test-flopen.c#1 branch .. //depot/projects/arm/src/tools/regression/lib/libutil/test-flopen.t#1 branch .. //depot/projects/arm/src/tools/tools/net80211/Makefile#3 integrate .. //depot/projects/arm/src/tools/tools/net80211/README#2 integrate .. //depot/projects/arm/src/tools/tools/net80211/wlandebug/Makefile#3 delete .. //depot/projects/arm/src/tools/tools/net80211/wlandebug/wlandebug.8#2 delete .. //depot/projects/arm/src/tools/tools/net80211/wlandebug/wlandebug.c#5 delete .. //depot/projects/arm/src/usr.bin/netstat/ipx.c#4 integrate .. //depot/projects/arm/src/usr.bin/tar/bsdtar.c#7 integrate .. //depot/projects/arm/src/usr.bin/truss/i386-fbsd.c#5 integrate .. //depot/projects/arm/src/usr.bin/truss/main.c#4 integrate .. //depot/projects/arm/src/usr.bin/truss/powerpc-fbsd.c#4 integrate .. //depot/projects/arm/src/usr.bin/truss/syscalls.c#3 integrate .. //depot/projects/arm/src/usr.bin/vmstat/vmstat.c#5 integrate .. //depot/projects/arm/src/usr.sbin/Makefile#14 integrate .. //depot/projects/arm/src/usr.sbin/acpi/acpidump/acpi_user.c#3 integrate .. //depot/projects/arm/src/usr.sbin/iostat/iostat.c#5 integrate .. //depot/projects/arm/src/usr.sbin/nscd/Makefile#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agent.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agent.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agents/Makefile.inc#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agents/group.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agents/group.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agents/passwd.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agents/passwd.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agents/services.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/agents/services.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/cachelib.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/cachelib.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/cacheplcs.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/cacheplcs.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/config.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/config.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/debug.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/debug.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/hashtable.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/log.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/log.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/mp_rs_query.#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/mp_rs_query.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/mp_rs_query.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/mp_ws_query.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/mp_ws_query.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/nscd.8#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/nscd.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/nscd.conf.5#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/nscdcli.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/nscdcli.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/parser.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/parser.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/protocol.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/protocol.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/query.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/query.h#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/singletons.c#1 branch .. //depot/projects/arm/src/usr.sbin/nscd/singletons.h#1 branch .. //depot/projects/arm/src/usr.sbin/portsnap/portsnap/portsnap.sh#3 integrate .. //depot/projects/arm/src/usr.sbin/wlandebug/Makefile#1 branch .. //depot/projects/arm/src/usr.sbin/wlandebug/wlandebug.8#1 branch .. //depot/projects/arm/src/usr.sbin/wlandebug/wlandebug.c#1 branch Differences ... ==== //depot/projects/arm/src/ObsoleteFiles.inc#25 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/ObsoleteFiles.inc,v 1.107 2007/07/17 17:28:59 delphij Exp $ +# $FreeBSD: src/ObsoleteFiles.inc,v 1.108 2007/08/02 08:04:47 bz Exp $ # # This file lists old files (OLD_FILES), libraries (OLD_LIBS) and # directories (OLD_DIRS) which should get removed at an update. Recently @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20070801: fast_ipsec.4 gone +OLD_FILES+=usr/share/man/man4/fast_ipsec.4.gz # 20070715: netatm temporarily disconnected OLD_FILES+=rescue/atm OLD_FILES+=rescue/fore_dnld ==== //depot/projects/arm/src/contrib/less/main.c#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/contrib/less/main.c,v 1.9 2007/06/23 15:28:00 delphij Exp $ */ +/* $FreeBSD: src/contrib/less/main.c,v 1.10 2007/08/04 13:16:09 deischen Exp $ */ /* * Copyright (C) 1984-2007 Mark Nudelman * @@ -165,7 +165,7 @@ quit(QUIT_OK); } - if (less_is_more && get_quit_at_eof()) + if (less_is_more || get_quit_at_eof()) no_init = quit_if_one_screen = TRUE; #if EDITOR ==== //depot/projects/arm/src/contrib/tcpdump/print-bgp.c#2 (text+ko) ==== @@ -622,6 +622,26 @@ return -2; } +/* + * As I remember, some versions of systems have an snprintf() that + * returns -1 if the buffer would have overflowed. If the return + * value is negative, set buflen to 0, to indicate that we've filled + * the buffer up. + * + * If the return value is greater than buflen, that means that + * the buffer would have overflowed; again, set buflen to 0 in + * that case. + */ +#define UPDATE_BUF_BUFLEN(buf, buflen, strlen) \ + if (strlen<0) \ + buflen=0; \ + else if ((u_int)strlen>buflen) \ + buflen=0; \ + else { \ + buflen-=strlen; \ + buf+=strlen; \ + } + static int decode_labeled_vpn_l2(const u_char *pptr, char *buf, u_int buflen) { @@ -632,11 +652,13 @@ tlen=plen; pptr+=2; TCHECK2(pptr[0],15); + buf[0]='\0'; strlen=snprintf(buf, buflen, "RD: %s, CE-ID: %u, Label-Block Offset: %u, Label Base %u", bgp_vpn_rd_print(pptr), EXTRACT_16BITS(pptr+8), EXTRACT_16BITS(pptr+10), EXTRACT_24BITS(pptr+12)>>4); /* the label is offsetted by 4 bits so lets shift it right */ + UPDATE_BUF_BUFLEN(buf, buflen, strlen); pptr+=15; tlen-=15; @@ -652,23 +674,32 @@ switch(tlv_type) { case 1: - strlen+=snprintf(buf+strlen,buflen-strlen, "\n\t\tcircuit status vector (%u) length: %u: 0x", - tlv_type, - tlv_len); + if (buflen!=0) { + strlen=snprintf(buf,buflen, "\n\t\tcircuit status vector (%u) length: %u: 0x", + tlv_type, + tlv_len); + UPDATE_BUF_BUFLEN(buf, buflen, strlen); + } ttlv_len=ttlv_len/8+1; /* how many bytes do we need to read ? */ while (ttlv_len>0) { TCHECK(pptr[0]); - strlen+=snprintf(buf+strlen,buflen-strlen, "%02x",*pptr++); + if (buflen!=0) { + strlen=snprintf(buf,buflen, "%02x",*pptr++); + UPDATE_BUF_BUFLEN(buf, buflen, strlen); + } ttlv_len--; } break; default: - snprintf(buf+strlen,buflen-strlen, "\n\t\tunknown TLV #%u, length: %u", - tlv_type, - tlv_len); + if (buflen!=0) { + strlen=snprintf(buf,buflen, "\n\t\tunknown TLV #%u, length: %u", + tlv_type, + tlv_len); + UPDATE_BUF_BUFLEN(buf, buflen, strlen); + } break; } - tlen-=(tlv_len<<3); /* the tlv-length is expressed in bits so lets shift it tright */ + tlen-=(tlv_len<<3); /* the tlv-length is expressed in bits so lets shift it right */ } return plen+2; ==== //depot/projects/arm/src/etc/namedb/named.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -// $FreeBSD: src/etc/namedb/named.conf,v 1.24 2007/06/18 06:29:45 dougb Exp $ +// $FreeBSD: src/etc/namedb/named.conf,v 1.25 2007/08/02 09:18:53 dougb Exp $ // // Refer to the named.conf(5) and named(8) man pages, and the documentation // in /usr/share/doc/bind9 for more details. @@ -15,10 +15,6 @@ dump-file "/var/dump/named_dump.db"; statistics-file "/var/stats/named.stats"; - disable-empty-zone "255.255.255.255.IN-ADDR.ARPA"; - disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA"; - disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA"; - // If named is being used only as a local resolver, this is a safe default. // For named to be accessible to the network, comment this option, specify // the proper IP address, or delete this option. @@ -29,6 +25,12 @@ // an IPv6 address, or the keyword "any". // listen-on-v6 { ::1; }; +// These zones are already covered by the empty zones listed below. +// If you remove the related empty zones below, comment these lines out. + disable-empty-zone "255.255.255.255.IN-ADDR.ARPA"; + disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA"; + disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA"; + // In addition to the "forwarders" clause, you can force your name // server to never initiate queries of its own, but always ask its // forwarders only, by enabling the following line: @@ -57,22 +59,23 @@ // first in your /etc/resolv.conf so this server will be queried. // Also, make sure to enable it in /etc/rc.conf. +// The traditional root hints mechanism. Use this, OR the slave zones below. +zone "." { type hint; file "named.root"; }; + /* Slaving the following zones from the root name servers has some significant advantages: 1. Faster local resolution for your users 2. No spurious traffic will be sent from your network to the roots 3. Greater resilience to any potential root server failure/DDoS - If you do not wish to slave these zones from the root servers - use the entry below instead. - zone "." { type hint; file "named.root"; }; + To use this mechanism, uncomment the entries below, and comment + the hint zone above. */ +/* zone "." { type slave; file "slave/root.slave"; masters { - 192.5.5.241; // F.ROOT-SERVERS.NET. - 192.228.79.201; // B.ROOT-SERVERS.NET. 192.33.4.12; // C.ROOT-SERVERS.NET. 192.112.36.4; // G.ROOT-SERVERS.NET. 193.0.14.129; // K.ROOT-SERVERS.NET. @@ -83,8 +86,6 @@ type slave; file "slave/arpa.slave"; masters { - 192.5.5.241; // F.ROOT-SERVERS.NET. - 192.228.79.201; // B.ROOT-SERVERS.NET. 192.33.4.12; // C.ROOT-SERVERS.NET. 192.112.36.4; // G.ROOT-SERVERS.NET. 193.0.14.129; // K.ROOT-SERVERS.NET. @@ -95,14 +96,13 @@ type slave; file "slave/in-addr.arpa.slave"; masters { - 192.5.5.241; // F.ROOT-SERVERS.NET. - 192.228.79.201; // B.ROOT-SERVERS.NET. 192.33.4.12; // C.ROOT-SERVERS.NET. 192.112.36.4; // G.ROOT-SERVERS.NET. 193.0.14.129; // K.ROOT-SERVERS.NET. }; notify no; }; +*/ /* Serving the following zones locally will prevent any queries for these zones leaving your network and going to the root ==== //depot/projects/arm/src/include/arpa/tftp.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tftp.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/arpa/tftp.h,v 1.5 2001/09/27 20:50:14 obrien Exp $ + * $FreeBSD: src/include/arpa/tftp.h,v 1.6 2007/08/01 11:59:09 ticso Exp $ */ #ifndef _ARPA_TFTP_H_ @@ -58,9 +58,9 @@ unsigned short tu_block; /* block # */ unsigned short tu_code; /* error code */ char tu_stuff[1]; /* request packet stuff */ - } th_u; + } __packed th_u; char th_data[1]; /* data or error string */ -}; +} __packed; #define th_block th_u.tu_block #define th_code th_u.tu_code ==== //depot/projects/arm/src/lib/libarchive/test/main.c#6 (text+ko) ==== @@ -32,7 +32,13 @@ #include #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.7 2007/07/14 17:52:01 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.8 2007/07/31 05:03:27 kientzle Exp $"); + +/* Interix doesn't define these in a standard header. */ +#if __INTERIX__ +extern char *optarg; +extern int optind; +#endif /* Default is to crash and try to force a core dump on failure. */ static int dump_on_failure = 1; @@ -101,6 +107,7 @@ static int skipped_line; void skipping_setup(const char *filename, int line) { + skipped_filename = filename; skipped_line = line; } void ==== //depot/projects/arm/src/lib/libc/net/name6.c#3 (text+ko) ==== @@ -88,7 +88,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/name6.c,v 1.61 2006/07/26 08:35:46 yar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/name6.c,v 1.62 2007/07/31 16:09:41 bushman Exp $"); #include "namespace.h" #include @@ -118,16 +118,8 @@ #include #include "un-namespace.h" #include "netdb_private.h" -#include "res_config.h" #include "res_private.h" -#ifdef NS_CACHING -#include "nscache.h" -#endif -#ifndef _PATH_HOSTS -#define _PATH_HOSTS "/etc/hosts" -#endif - #ifndef MAXALIASES #define MAXALIASES 10 #endif @@ -153,7 +145,7 @@ } while (0) #define MAPADDRENABLED(flags) \ (((flags) & AI_V4MAPPED) || \ - (((flags) & AI_V4MAPPED_CFG) && _mapped_addr_enabled())) + (((flags) & AI_V4MAPPED_CFG))) union inx_addr { struct in_addr in_addr; @@ -202,14 +194,11 @@ static struct hostent *_hpcopy(struct hostent *, int *); static struct hostent *_hpaddr(int, const char *, void *, int *); +#ifdef INET6 static struct hostent *_hpmerge(struct hostent *, struct hostent *, int *); -#ifdef INET6 static struct hostent *_hpmapv6(struct hostent *, int *); #endif static struct hostent *_hpsort(struct hostent *, res_state); -static struct hostent *_ghbyname(const char *, int, int, int *); -static char *_hgetword(char **); -static int _mapped_addr_enabled(void); static struct hostent *_hpreorder(struct hostent *); static int get_addrselectpolicy(struct policyhead *); @@ -221,325 +210,30 @@ static int comp_dst(const void *, const void *); static int gai_addr2scopetype(struct sockaddr *); -static FILE *_files_open(int *); -static int _files_ghbyname(void *, void *, va_list); -static int _files_ghbyaddr(void *, void *, va_list); -#ifdef YP -static int _nis_ghbyname(void *, void *, va_list); -static int _nis_ghbyaddr(void *, void *, va_list); -#endif -static int _dns_ghbyname(void *, void *, va_list); -static int _dns_ghbyaddr(void *, void *, va_list); -static void _dns_shent(int) __unused; -static void _dns_ehent(void) __unused; -#ifdef ICMPNL -static int _icmp_ghbyaddr(void *, void *, va_list); -#endif /* ICMPNL */ -#ifdef NS_CACHING -static int ipnode_id_func(char *, size_t *, va_list, void *); -static int ipnode_marshal_func(char *, size_t *, void *, va_list, void *); -static int ipnode_unmarshal_func(char *, size_t, void *, va_list, void *); -#endif - -/* Host lookup order if nsswitch.conf is broken or nonexistant */ -static const ns_src default_src[] = { - { NSSRC_FILES, NS_SUCCESS }, - { NSSRC_DNS, NS_SUCCESS }, -#ifdef ICMPNL -#define NSSRC_ICMP "icmp" - { NSSRC_ICMP, NS_SUCCESS }, -#endif - { 0 } -}; - /* - * Check if kernel supports mapped address. - * implementation dependent + * Functions defined in RFC2553 + * getipnodebyname, getipnodebyaddr, freehostent */ -#ifdef __KAME__ -#include -#endif /* __KAME__ */ -static int -_mapped_addr_enabled(void) +struct hostent * +getipnodebyname(const char *name, int af, int flags, int *errp) { - /* implementation dependent check */ -#if defined(__KAME__) && defined(IPV6CTL_MAPPED_ADDR) - int mib[4]; - size_t len; - int val; - - mib[0] = CTL_NET; - mib[1] = PF_INET6; - mib[2] = IPPROTO_IPV6; - mib[3] = IPV6CTL_MAPPED_ADDR; - len = sizeof(val); - if (sysctl(mib, 4, &val, &len, 0, 0) == 0 && val != 0) - return 1; -#endif /* __KAME__ && IPV6CTL_MAPPED_ADDR */ - return 0; -} - -#ifdef NS_CACHING -static int -ipnode_id_func(char *buffer, size_t *buffer_size, va_list ap, - void *cache_mdata) -{ + struct hostent *hp; + union inx_addr addrbuf; res_state statp; - u_long res_options; + u_long options; - const int op_id = 2; - char *name; - int af; - size_t len; - void *src; - - char *p; - size_t desired_size, size; - enum nss_lookup_type lookup_type; - int res = NS_UNAVAIL; - - statp = __res_state(); - res_options = statp->options & (RES_RECURSE | RES_DEFNAMES | - RES_DNSRCH | RES_NOALIASES | RES_USE_INET6); - - lookup_type = (enum nss_lookup_type)cache_mdata; - switch (lookup_type) { - case nss_lt_name: - name = va_arg(ap, char *); - af = va_arg(ap, int); - - size = strlen(name); - desired_size = sizeof(res_options) + sizeof(int) + - sizeof(enum nss_lookup_type) + sizeof(int) + size + 1; - - if (desired_size > *buffer_size) { - res = NS_RETURN; - goto fin; - } - - p = buffer; - memcpy(p, &res_options, sizeof(res_options)); - p += sizeof(res_options); - - memcpy(p, &op_id, sizeof(int)); - p += sizeof(int); - - memcpy(p, &lookup_type, sizeof(enum nss_lookup_type)); - p += sizeof(enum nss_lookup_type); - - memcpy(p, &af, sizeof(int)); - p += sizeof(int); - - memcpy(p, name, size + 1); - - res = NS_SUCCESS; + switch (af) { + case AF_INET: +#ifdef INET6 + case AF_INET6: +#endif break; - case nss_lt_id: - src = va_arg(ap, void *); - len = va_arg(ap, size_t); - af = va_arg(ap, int); - - desired_size = sizeof(res_options) + sizeof(int) + - sizeof(enum nss_lookup_type) + sizeof(int) + - sizeof(size_t) + len; - - if (desired_size > *buffer_size) { - res = NS_RETURN; - goto fin; - } - - p = buffer; - memcpy(p, &res_options, sizeof(res_options)); - p += sizeof(res_options); - - memcpy(p, &op_id, sizeof(int)); - p += sizeof(int); - - memcpy(p, &lookup_type, sizeof(enum nss_lookup_type)); - p += sizeof(enum nss_lookup_type); - - memcpy(p, &af, sizeof(int)); - p += sizeof(int); - - memcpy(p, &len, sizeof(size_t)); - p += sizeof(size_t); - - memcpy(p, src, len); - - res = NS_SUCCESS; - break; default: - /* should be unreachable */ - return (NS_UNAVAIL); - } - -fin: - *buffer_size = desired_size; - return (res); -} - -static int -ipnode_marshal_func(char *buffer, size_t *buffer_size, void *retval, - va_list ap, void *cache_mdata) -{ - struct hostent *ht; - - struct hostent new_ht; - size_t desired_size, aliases_size, addr_size, size; - char *p, **iter; - - ht = *((struct hostent **)retval); - - desired_size = _ALIGNBYTES + sizeof(struct hostent) + sizeof(char *); - if (ht->h_name != NULL) - desired_size += strlen(ht->h_name) + 1; - - if (ht->h_aliases != NULL) { - aliases_size = 0; - for (iter = ht->h_aliases; *iter; ++iter) { - desired_size += strlen(*iter) + 1; - ++aliases_size; - } - - desired_size += _ALIGNBYTES + - (aliases_size + 1) * sizeof(char *); - } - - if (ht->h_addr_list != NULL) { - addr_size = 0; - for (iter = ht->h_addr_list; *iter; ++iter) - ++addr_size; - - desired_size += addr_size * _ALIGN(ht->h_length); - desired_size += _ALIGNBYTES + (addr_size + 1) * sizeof(char *); - } - - if (desired_size > *buffer_size) { - /* this assignment is here for future use */ - *buffer_size = desired_size; - return (NS_RETURN); - } - - memcpy(&new_ht, ht, sizeof(struct hostent)); - memset(buffer, 0, desired_size); - - *buffer_size = desired_size; - p = buffer + sizeof(struct hostent) + sizeof(char *); - memcpy(buffer + sizeof(struct hostent), &p, sizeof(char *)); - p = (char *)_ALIGN(p); - - if (new_ht.h_name != NULL) { - size = strlen(new_ht.h_name); - memcpy(p, new_ht.h_name, size); - new_ht.h_name = p; - p += size + 1; - } - - if (new_ht.h_aliases != NULL) { - p = (char *)_ALIGN(p); - memcpy(p, new_ht.h_aliases, sizeof(char *) * aliases_size); - new_ht.h_aliases = (char **)p; - p += sizeof(char *) * (aliases_size + 1); - - for (iter = new_ht.h_aliases; *iter; ++iter) { - size = strlen(*iter); - memcpy(p, *iter, size); - *iter = p; - p += size + 1; - } - } - - if (new_ht.h_addr_list != NULL) { - p = (char *)_ALIGN(p); - memcpy(p, new_ht.h_addr_list, sizeof(char *) * addr_size); - new_ht.h_addr_list = (char **)p; - p += sizeof(char *) * (addr_size + 1); - - size = _ALIGN(new_ht.h_length); - for (iter = new_ht.h_addr_list; *iter; ++iter) { - memcpy(p, *iter, size); - *iter = p; - p += size + 1; - } + *errp = NO_RECOVERY; + return NULL; } - memcpy(buffer, &new_ht, sizeof(struct hostent)); - return (NS_SUCCESS); -} -static int -ipnode_unmarshal_func(char *buffer, size_t buffer_size, void *retval, - va_list ap, void *cache_mdata) -{ - struct hostent new_ht; - struct hostent *ht; - - char *p; - char **iter; - char *orig_buf; - int err; - - ht = &new_ht; - - memcpy(ht, buffer, sizeof(struct hostent)); - memcpy(&p, buffer + sizeof(struct hostent), sizeof(char *)); - - orig_buf = buffer + sizeof(struct hostent) + sizeof(char *) + - _ALIGN(p) - (size_t)p; - p = (char *)_ALIGN(p); - - - NS_APPLY_OFFSET(ht->h_name, orig_buf, p, char *); - if (ht->h_aliases != NULL) { - NS_APPLY_OFFSET(ht->h_aliases, orig_buf, p, char **); - - for (iter = ht->h_aliases; *iter; ++iter) - NS_APPLY_OFFSET(*iter, orig_buf, p, char *); - } - - if (ht->h_addr_list != NULL) { - NS_APPLY_OFFSET(ht->h_addr_list, orig_buf, p, char **); - - for (iter = ht->h_addr_list; *iter; ++iter) - NS_APPLY_OFFSET(*iter, orig_buf, p, char *); - } - - ht = _hpcopy(ht, &err); - if (ht == NULL) - return (NS_UNAVAIL); - - *((struct hostent **)retval) = ht; - return (NS_SUCCESS); -} -#endif - -/* - * Functions defined in RFC2553 - * getipnodebyname, getipnodebyaddr, freehostent - */ - -static struct hostent * -_ghbyname(const char *name, int af, int flags, int *errp) -{ - struct hostent *hp; - int rval; - -#ifdef NS_CACHING - static const nss_cache_info cache_info = - NS_COMMON_CACHE_INFO_INITIALIZER( - hosts, (void *)nss_lt_name, - ipnode_id_func, ipnode_marshal_func, ipnode_unmarshal_func); -#endif - static const ns_dtab dtab[] = { - NS_FILES_CB(_files_ghbyname, NULL) - { NSSRC_DNS, _dns_ghbyname, NULL }, - NS_NIS_CB(_nis_ghbyname, NULL) -#ifdef NS_CACHING - NS_CACHE_CB(&cache_info) -#endif - { 0 } - }; - if (flags & AI_ADDRCONFIG) { int s; @@ -554,31 +248,8 @@ */ _close(s); } - - rval = _nsdispatch(&hp, dtab, NSDB_HOSTS, "ghbyname", default_src, - name, af, errp); - return (rval == NS_SUCCESS) ? hp : NULL; -} - -struct hostent * -getipnodebyname(const char *name, int af, int flags, int *errp) -{ - struct hostent *hp; - union inx_addr addrbuf; - res_state statp; - - switch (af) { - case AF_INET: + #ifdef INET6 - case AF_INET6: -#endif - break; - default: - *errp = NO_RECOVERY; - return NULL; - } - -#ifdef INET6 /* special case for literal address */ if (inet_pton(AF_INET6, name, &addrbuf) == 1) { if (af != AF_INET6) { @@ -600,6 +271,7 @@ return _hpaddr(af, name, &addrbuf, errp); } + statp = __res_state(); if ((statp->options & RES_INIT) == 0) { if (res_ninit(statp) < 0) { @@ -607,25 +279,36 @@ return NULL; } } + + options = statp->options; + statp->options &= ~RES_USE_INET6; + + hp = gethostbyname2(name, af); + hp = _hpcopy(hp, errp); - *errp = HOST_NOT_FOUND; - hp = _ghbyname(name, af, flags, errp); - #ifdef INET6 if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) && MAPADDRENABLED(flags)) { - struct hostent *hp2 = _ghbyname(name, AF_INET, flags, errp); + struct hostent *hp2 = gethostbyname2(name, AF_INET); if (hp == NULL) - hp = _hpmapv6(hp2, errp); + if (hp2 == NULL) + *errp = statp->res_h_errno; + else + hp = _hpmapv6(hp2, errp); else { - if (hp2 && strcmp(hp->h_name, hp2->h_name) != 0) { - freehostent(hp2); - hp2 = NULL; + if (hp2 && strcmp(hp->h_name, hp2->h_name) == 0) { + struct hostent *hpb = hp; + hp = _hpmerge(hpb, hp2, errp); + freehostent(hpb); } - hp = _hpmerge(hp, hp2, errp); } } #endif + + if (hp == NULL) + *errp = statp->res_h_errno; + + statp->options = options; return _hpreorder(_hpsort(hp, statp)); } @@ -633,34 +316,15 @@ getipnodebyaddr(const void *src, size_t len, int af, int *errp) { struct hostent *hp; - int rval; + res_state statp; + u_long options; + #ifdef INET6 struct in6_addr addrbuf; #else struct in_addr addrbuf; #endif - -#ifdef NS_CACHING - static const nss_cache_info cache_info = - NS_COMMON_CACHE_INFO_INITIALIZER( - hosts, (void *)nss_lt_id, - ipnode_id_func, ipnode_marshal_func, ipnode_unmarshal_func); -#endif - static const ns_dtab dtab[] = { - NS_FILES_CB(_files_ghbyaddr, NULL) - { NSSRC_DNS, _dns_ghbyaddr, NULL }, - NS_NIS_CB(_nis_ghbyaddr, NULL) -#ifdef ICMPNL - { NSSRC_ICMP, _icmp_ghbyaddr, NULL }, -#endif -#ifdef NS_CACHING - NS_CACHE_CB(&cache_info) -#endif - { 0 } - }; - - *errp = HOST_NOT_FOUND; - + switch (af) { case AF_INET: if (len != sizeof(struct in_addr)) { @@ -700,9 +364,23 @@ return NULL; } - rval = _nsdispatch(&hp, dtab, NSDB_HOSTS, "ghbyaddr", default_src, - src, len, af, errp); - return (rval == NS_SUCCESS) ? hp : NULL; + statp = __res_state(); + if ((statp->options & RES_INIT) == 0) { + if (res_ninit(statp) < 0) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); + return NULL; + } + } + + options = statp->options; + statp->options &= ~RES_USE_INET6; + + hp = gethostbyaddr(src, len, af); + if (hp == NULL) + *errp = statp->res_h_errno; + + statp->options = options; + return (_hpcopy(hp, errp)); } void @@ -811,9 +489,10 @@ hp->h_addr_list = addrs; addrs[0] = (char *)addr; addrs[1] = NULL; - return _hpcopy(hp, errp); + return (_hpcopy(hp, errp)); } +#ifdef INET6 /* * _hpmerge: merge 2 hostent structure, arguments will be freed */ @@ -828,9 +507,9 @@ union inx_addr addrbuf[MAXADDRS]; if (hp1 == NULL) - return hp2; + return _hpcopy(hp2, errp); if (hp2 == NULL) - return hp1; + return _hpcopy(hp1, errp); #define HP(i) (i == 1 ? hp1 : hp2) hp = &hpbuf; @@ -850,17 +529,14 @@ } } aliases[nalias] = NULL; >>> TRUNCATED FOR MAIL (1000 lines) <<<