Date: Tue, 29 Dec 2015 01:21:41 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292857 - in user/ngie/stable-10-libnv: bin/ed bin/sh contrib/netbsd-tests/lib/libc/gen contrib/netbsd-tests/lib/libc/ssp contrib/netbsd-tests/usr.bin/grep contrib/smbfs etc etc/default... Message-ID: <201512290121.tBT1LfL5022035@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Tue Dec 29 01:21:40 2015 New Revision: 292857 URL: https://svnweb.freebsd.org/changeset/base/292857 Log: MFstable/10 @ r292856 Added: user/ngie/stable-10-libnv/lib/libc/tests/nss/ - copied from r292856, stable/10/lib/libc/tests/nss/ user/ngie/stable-10-libnv/lib/libc/tests/resolv/ - copied from r292856, stable/10/lib/libc/tests/resolv/ user/ngie/stable-10-libnv/sys/dev/rl/ - copied from r292856, stable/10/sys/dev/rl/ user/ngie/stable-10-libnv/sys/netinet/tcp_fastopen.c - copied unchanged from r292856, stable/10/sys/netinet/tcp_fastopen.c user/ngie/stable-10-libnv/sys/netinet/tcp_fastopen.h - copied unchanged from r292856, stable/10/sys/netinet/tcp_fastopen.h user/ngie/stable-10-libnv/sys/sparc64/pci/ofw_pci.c - copied unchanged from r292856, stable/10/sys/sparc64/pci/ofw_pci.c Deleted: user/ngie/stable-10-libnv/sys/pci/if_rl.c user/ngie/stable-10-libnv/sys/pci/if_rlreg.h Modified: user/ngie/stable-10-libnv/bin/ed/main.c user/ngie/stable-10-libnv/bin/sh/mknodes.c user/ngie/stable-10-libnv/bin/sh/var.c user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/gen/t_assert.c user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/d_binary.out user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/t_grep.sh user/ngie/stable-10-libnv/contrib/smbfs/README user/ngie/stable-10-libnv/etc/defaults/periodic.conf user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist user/ngie/stable-10-libnv/etc/periodic/daily/800.scrub-zfs user/ngie/stable-10-libnv/etc/periodic/security/520.pfdenied user/ngie/stable-10-libnv/etc/services user/ngie/stable-10-libnv/gnu/usr.bin/Makefile user/ngie/stable-10-libnv/include/netdb.h user/ngie/stable-10-libnv/lib/libc/gen/lockf.c user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.3 user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.c user/ngie/stable-10-libnv/lib/libc/net/map_v4v6.c user/ngie/stable-10-libnv/lib/libc/net/name6.c user/ngie/stable-10-libnv/lib/libc/sys/clock_gettime.2 user/ngie/stable-10-libnv/lib/libc/sys/gettimeofday.2 user/ngie/stable-10-libnv/lib/libc/tests/Makefile user/ngie/stable-10-libnv/lib/liblzma/Makefile user/ngie/stable-10-libnv/share/examples/tests/tests/atf/printf_test.c user/ngie/stable-10-libnv/share/mk/bsd.README user/ngie/stable-10-libnv/share/mk/bsd.test.mk user/ngie/stable-10-libnv/share/mk/suite.test.mk user/ngie/stable-10-libnv/share/mk/tap.test.mk user/ngie/stable-10-libnv/sys/conf/files user/ngie/stable-10-libnv/sys/conf/files.sparc64 user/ngie/stable-10-libnv/sys/conf/options user/ngie/stable-10-libnv/sys/contrib/ipfilter/netinet/ip_nat.c user/ngie/stable-10-libnv/sys/dev/hyperv/vmbus/hv_channel_mgmt.c user/ngie/stable-10-libnv/sys/dev/md/md.c user/ngie/stable-10-libnv/sys/dev/mii/rgephy.c user/ngie/stable-10-libnv/sys/dev/mii/rlphy.c user/ngie/stable-10-libnv/sys/dev/mii/rlswitch.c user/ngie/stable-10-libnv/sys/dev/mpt/mpt.c user/ngie/stable-10-libnv/sys/dev/mpt/mpt.h user/ngie/stable-10-libnv/sys/dev/re/if_re.c user/ngie/stable-10-libnv/sys/dev/usb/net/if_urndis.c user/ngie/stable-10-libnv/sys/dev/vt/colors/vt_termcolors.c user/ngie/stable-10-libnv/sys/modules/hyperv/netvsc/Makefile user/ngie/stable-10-libnv/sys/modules/rl/Makefile user/ngie/stable-10-libnv/sys/netgraph/ng_base.c user/ngie/stable-10-libnv/sys/netinet/tcp.h user/ngie/stable-10-libnv/sys/netinet/tcp_input.c user/ngie/stable-10-libnv/sys/netinet/tcp_output.c user/ngie/stable-10-libnv/sys/netinet/tcp_subr.c user/ngie/stable-10-libnv/sys/netinet/tcp_syncache.c user/ngie/stable-10-libnv/sys/netinet/tcp_syncache.h user/ngie/stable-10-libnv/sys/netinet/tcp_timer.c user/ngie/stable-10-libnv/sys/netinet/tcp_usrreq.c user/ngie/stable-10-libnv/sys/netinet/tcp_var.h user/ngie/stable-10-libnv/sys/sparc64/ebus/ebus.c user/ngie/stable-10-libnv/sys/sparc64/include/md_var.h user/ngie/stable-10-libnv/sys/sparc64/include/smp.h user/ngie/stable-10-libnv/sys/sparc64/pci/fire.c user/ngie/stable-10-libnv/sys/sparc64/pci/firereg.h user/ngie/stable-10-libnv/sys/sparc64/pci/firevar.h user/ngie/stable-10-libnv/sys/sparc64/pci/ofw_pci.h user/ngie/stable-10-libnv/sys/sparc64/pci/psycho.c user/ngie/stable-10-libnv/sys/sparc64/pci/psychoreg.h user/ngie/stable-10-libnv/sys/sparc64/pci/psychovar.h user/ngie/stable-10-libnv/sys/sparc64/pci/schizo.c user/ngie/stable-10-libnv/sys/sparc64/pci/schizoreg.h user/ngie/stable-10-libnv/sys/sparc64/pci/schizovar.h user/ngie/stable-10-libnv/sys/sparc64/sparc64/machdep.c user/ngie/stable-10-libnv/sys/sparc64/sparc64/mp_machdep.c user/ngie/stable-10-libnv/sys/ufs/ffs/ffs_softdep.c user/ngie/stable-10-libnv/sys/x86/x86/busdma_bounce.c user/ngie/stable-10-libnv/tests/freebsd_test_suite/macros.h user/ngie/stable-10-libnv/tests/sys/file/flock_test.sh user/ngie/stable-10-libnv/tools/debugscripts/README user/ngie/stable-10-libnv/tools/regression/lib/libc/nss/mach user/ngie/stable-10-libnv/tools/regression/lib/libc/resolv/mach user/ngie/stable-10-libnv/tools/regression/lib/msun/test-ctrig.c user/ngie/stable-10-libnv/tools/regression/lib/msun/test-exponential.c user/ngie/stable-10-libnv/tools/regression/lib/msun/test-fma.c user/ngie/stable-10-libnv/tools/regression/lib/msun/test-invtrig.c user/ngie/stable-10-libnv/tools/regression/mac/mac_portacl/misc.sh user/ngie/stable-10-libnv/tools/regression/mac/mac_portacl/nobody.t user/ngie/stable-10-libnv/tools/regression/mac/mac_portacl/root.t user/ngie/stable-10-libnv/usr.bin/bc/bc.1 user/ngie/stable-10-libnv/usr.bin/bc/bc.y user/ngie/stable-10-libnv/usr.bin/bc/extern.h user/ngie/stable-10-libnv/usr.bin/bc/tty.c user/ngie/stable-10-libnv/usr.sbin/sysrc/sysrc user/ngie/stable-10-libnv/usr.sbin/sysrc/sysrc.8 user/ngie/stable-10-libnv/usr.sbin/uhsoctl/uhsoctl.c user/ngie/stable-10-libnv/usr.sbin/ypserv/Makefile.yp Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/bin/ed/main.c ============================================================================== --- user/ngie/stable-10-libnv/bin/ed/main.c Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/bin/ed/main.c Tue Dec 29 01:21:40 2015 (r292857) @@ -505,7 +505,8 @@ exec_command(void) return ERR; else if (open_sbuf() < 0) return FATAL; - if (*fnp && *fnp != '!') strcpy(old_filename, fnp); + if (*fnp && *fnp != '!') + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -532,7 +533,8 @@ exec_command(void) return ERR; } GET_COMMAND_SUFFIX(); - if (*fnp) strcpy(old_filename, fnp); + if (*fnp) + strlcpy(old_filename, fnp, PATH_MAX); printf("%s\n", strip_escapes(old_filename)); break; case 'g': @@ -663,7 +665,7 @@ exec_command(void) GET_COMMAND_SUFFIX(); if (!isglobal) clear_undo_stack(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -797,7 +799,7 @@ exec_command(void) return ERR; GET_COMMAND_SUFFIX(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; Modified: user/ngie/stable-10-libnv/bin/sh/mknodes.c ============================================================================== --- user/ngie/stable-10-libnv/bin/sh/mknodes.c Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/bin/sh/mknodes.c Tue Dec 29 01:21:40 2015 (r292857) @@ -89,7 +89,6 @@ static struct str *nodestr[MAXTYPES]; /* static int nstr; /* number of structures */ static struct str str[MAXTYPES]; /* the structures */ static struct str *curstr; /* current structure */ -static FILE *infp; static char line[1024]; static int linno; static char *linep; @@ -102,7 +101,7 @@ static void outfunc(FILE *, int); static void indent(int, FILE *); static int nextfield(char *); static void skipbl(void); -static int readline(void); +static int readline(FILE *); static void error(const char *, ...) __printf0like(1, 2) __dead2; static char *savestr(const char *); @@ -110,17 +109,19 @@ static char *savestr(const char *); int main(int argc, char *argv[]) { + FILE *infp; + if (argc != 3) error("usage: mknodes file"); - infp = stdin; if ((infp = fopen(argv[1], "r")) == NULL) error("Can't open %s: %s", argv[1], strerror(errno)); - while (readline()) { + while (readline(infp)) { if (line[0] == ' ' || line[0] == '\t') parsefield(); else if (line[0] != '\0') parsenode(); } + fclose(infp); output(argv[2]); exit(0); } @@ -253,6 +254,10 @@ output(char *file) fputs("union node *getfuncnode(struct funcdef *);\n", hfile); fputs("void reffunc(struct funcdef *);\n", hfile); fputs("void unreffunc(struct funcdef *);\n", hfile); + if (ferror(hfile)) + error("Can't write to nodes.h"); + if (fclose(hfile)) + error("Can't close nodes.h"); fputs(writer, cfile); while (fgets(line, sizeof line, patfile) != NULL) { @@ -266,6 +271,11 @@ output(char *file) else fputs(line, cfile); } + fclose(patfile); + if (ferror(cfile)) + error("Can't write to nodes.c"); + if (fclose(cfile)) + error("Can't close nodes.c"); } @@ -401,7 +411,7 @@ skipbl(void) static int -readline(void) +readline(FILE *infp) { char *p; Modified: user/ngie/stable-10-libnv/bin/sh/var.c ============================================================================== --- user/ngie/stable-10-libnv/bin/sh/var.c Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/bin/sh/var.c Tue Dec 29 01:21:40 2015 (r292857) @@ -328,7 +328,7 @@ setvareq(char *s, int flags) if (vp->flags & VREADONLY) { if ((flags & (VTEXTFIXED|VSTACK)) == 0) ckfree(s); - error("%.*s: is read only", vp->name_len, s); + error("%.*s: is read only", vp->name_len, vp->text); } if (flags & VNOSET) { if ((flags & (VTEXTFIXED|VSTACK)) == 0) Modified: user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/gen/t_assert.c ============================================================================== --- user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/gen/t_assert.c Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/gen/t_assert.c Tue Dec 29 01:21:40 2015 (r292857) @@ -40,6 +40,23 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/ #include <string.h> #include <unistd.h> +#ifdef __FreeBSD__ +#include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> + +static void +disable_corefile(void) +{ + struct rlimit limits; + + limits.rlim_cur = 0; + limits.rlim_max = 0; + + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0); +} +#endif + static void handler(int); static void @@ -65,6 +82,9 @@ ATF_TC_BODY(assert_false, tc) if (pid == 0) { +#ifdef __FreeBSD__ + disable_corefile(); +#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); @@ -102,6 +122,9 @@ ATF_TC_BODY(assert_true, tc) if (pid == 0) { +#ifdef __FreeBSD__ + disable_corefile(); +#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); Modified: user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh ============================================================================== --- user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Tue Dec 29 01:21:40 2015 (r292857) @@ -35,6 +35,7 @@ h_fail() { echo "Executing command [ $2$1 ]" # Begin FreeBSD + ulimit -c 0 if true; then eval $2 atf_check -s signal -o ignore -e ignore $1 else Modified: user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/d_binary.out ============================================================================== --- user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/d_binary.out Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/d_binary.out Tue Dec 29 01:21:40 2015 (r292857) @@ -1 +1 @@ -Binary file /bin/sh matches +Binary file test.file matches Modified: user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue Dec 29 01:21:40 2015 (r292857) @@ -43,7 +43,20 @@ binary_head() } binary_body() { + # Begin FreeBSD + # + # Generate stable output instead of depending on uname to match the + # branded OS name of /bin/sh + if true; then + dd if=/dev/zero count=1 of=test.file + echo -n "foobar" >> test.file + atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file + else + # End FreeBSD atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case recurse Modified: user/ngie/stable-10-libnv/contrib/smbfs/README ============================================================================== --- user/ngie/stable-10-libnv/contrib/smbfs/README Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/contrib/smbfs/README Tue Dec 29 01:21:40 2015 (r292857) @@ -15,7 +15,7 @@ It is a complete, kernel side implementa Darwin maintained in the Darwin's tree. - I'm would be very grateful for any feedback, bug reports etc. + I would be very grateful for any feedback, bug reports etc. Supported SMB servers: Samba @@ -23,14 +23,14 @@ It is a complete, kernel side implementa IBM LanManager NetApp - An updated versions of this package can be retrieved from ftp server: + An updated version of this package can be retrieved from ftp server: ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz - Perfomance + Performance ========== - There is some perfomance benchmarks over 10Mbit network: + These are some performance benchmarks over a 10Mbit network: Win95 machine as server: IOZONE: auto-test mode Modified: user/ngie/stable-10-libnv/etc/defaults/periodic.conf ============================================================================== --- user/ngie/stable-10-libnv/etc/defaults/periodic.conf Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/etc/defaults/periodic.conf Tue Dec 29 01:21:40 2015 (r292857) @@ -319,8 +319,8 @@ if [ -z "${source_periodic_confs_defined "use \$$var instead." >&2 case "$value" in [Yy][Ee][Ss]) - $var=YES - $periodvar=daily + eval $var=YES + eval $periodvar=daily ;; *) eval $var=\"$value\" Modified: user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist ============================================================================== --- user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist Tue Dec 29 01:21:40 2015 (r292857) @@ -109,10 +109,14 @@ .. .. .. + nss + .. regex data .. .. + resolv + .. rpc .. ssp Modified: user/ngie/stable-10-libnv/etc/periodic/daily/800.scrub-zfs ============================================================================== --- user/ngie/stable-10-libnv/etc/periodic/daily/800.scrub-zfs Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/etc/periodic/daily/800.scrub-zfs Tue Dec 29 01:21:40 2015 (r292857) @@ -43,6 +43,10 @@ case "$daily_scrub_zfs_enable" in rc=3 echo "Skipping faulted pool: ${pool}" continue ;; + *UNAVAIL*) + rc=4 + echo "Skipping unavailable pool: ${pool}" + continue ;; esac # determine how many days shall be between scrubs Modified: user/ngie/stable-10-libnv/etc/periodic/security/520.pfdenied ============================================================================== --- user/ngie/stable-10-libnv/etc/periodic/security/520.pfdenied Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/etc/periodic/security/520.pfdenied Tue Dec 29 01:21:40 2015 (r292857) @@ -44,7 +44,7 @@ rc=0 if check_yesno_period security_status_pfdenied_enable then TMP=`mktemp -t security` - if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); print buf$0;} }' > ${TMP}; then + if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then check_diff new_only pf ${TMP} "${host} pf denied packets:" fi rc=$? Modified: user/ngie/stable-10-libnv/etc/services ============================================================================== --- user/ngie/stable-10-libnv/etc/services Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/etc/services Tue Dec 29 01:21:40 2015 (r292857) @@ -1029,7 +1029,7 @@ nntps 563/udp snntp #nntp protocol o whoami 565/tcp whoami 565/udp streettalk 566/tcp -streettalk 566/udp +streettalk 566/udp banyan-rpc 567/tcp banyan-rpc 567/udp ms-shuttle 568/tcp #Microsoft shuttle @@ -1099,16 +1099,16 @@ acp 599/tcp #Aeolon Core Protocol acp 599/udp #Aeolon Core Protocol ipcserver 600/tcp #Sun IPC server ipcserver 600/udp #Sun IPC server -syslog-conn 601/tcp #Reliable Syslog Service -syslog-conn 601/udp #Reliable Syslog Service -xmlrpc-beep 602/tcp #XML-RPC over BEEP -xmlrpc-beep 602/udp #XML-RPC over BEEP -idxp 603/tcp -idxp 603/udp -tunnel 604/tcp -tunnel 604/udp -soap-beep 605/tcp #SOAP over BEEP -soap-beep 605/udp #SOAP over BEEP +syslog-conn 601/tcp #Reliable Syslog Service +syslog-conn 601/udp #Reliable Syslog Service +xmlrpc-beep 602/tcp #XML-RPC over BEEP +xmlrpc-beep 602/udp #XML-RPC over BEEP +idxp 603/tcp +idxp 603/udp +tunnel 604/tcp +tunnel 604/udp +soap-beep 605/tcp #SOAP over BEEP +soap-beep 605/udp #SOAP over BEEP urm 606/tcp #Cray Unified Resource Manager urm 606/udp #Cray Unified Resource Manager nqs 607/tcp @@ -1137,14 +1137,14 @@ dei-icda 618/tcp dei-icda 618/udp compaq-evm 619/tcp #Compaq EVM compaq-evm 619/udp #Compaq EVM -sco-websrvrmgr 620/tcp #SCO WebServer Manager -sco-websrvrmgr 620/udp #SCO WebServer Manager +sco-websrvrmgr 620/tcp #SCO WebServer Manager +sco-websrvrmgr 620/udp #SCO WebServer Manager escp-ip 621/tcp #ESCP escp-ip 621/udp #ESCP collaborator 622/tcp collaborator 622/udp -asf-rmcp 623/tcp #ASF Remote Management and Control Protocol -asf-rmcp 623/udp #ASF Remote Management and Control Protocol +asf-rmcp 623/tcp #ASF Remote Management and Control Protocol +asf-rmcp 623/udp #ASF Remote Management and Control Protocol cryptoadmin 624/tcp #Crypto Admin cryptoadmin 624/udp #Crypto Admin dec_dlm 625/tcp #DEC DLM @@ -1167,12 +1167,12 @@ servstat 633/tcp #Service Status upda servstat 633/udp #Service Status update (Sterling Software) ginad 634/tcp ginad 634/udp -rlzdbase 635/tcp #RLZ DBase -rlzdbase 635/udp #RLZ DBase +rlzdbase 635/tcp #RLZ DBase +rlzdbase 635/udp #RLZ DBase ldaps 636/tcp sldap #ldap protocol over TLS/SSL ldaps 636/udp sldap -lanserver 637/tcp -lanserver 637/udp +lanserver 637/tcp +lanserver 637/udp mcns-sec 638/tcp mcns-sec 638/udp msdp 639/tcp @@ -1191,12 +1191,12 @@ pssc 645/tcp pssc 645/udp ldp 646/tcp ldp 646/udp -dhcp-failover 647/tcp #DHCP Failover -dhcp-failover 647/udp #DHCP Failover -rrp 648/tcp #Registry Registrar Protocol (RRP) -rrp 648/udp #Registry Registrar Protocol (RRP) -cadview-3d 649/tcp #Cadview-3d - streaming 3d models over the internet -cadview-3d 649/udp #Cadview-3d - streaming 3d models over the internet +dhcp-failover 647/tcp #DHCP Failover +dhcp-failover 647/udp #DHCP Failover +rrp 648/tcp #Registry Registrar Protocol (RRP) +rrp 648/udp #Registry Registrar Protocol (RRP) +cadview-3d 649/tcp #Cadview-3d - streaming 3d models over the internet +cadview-3d 649/udp #Cadview-3d - streaming 3d models over the internet obex 650/tcp obex 650/udp ieee-mms 651/tcp #IEEE MMS @@ -1215,38 +1215,38 @@ rmc 657/tcp rmc 657/udp tenfold 658/tcp tenfold 658/udp -mac-srvr-admin 660/tcp #MacOS Server Admin -mac-srvr-admin 660/udp #MacOS Server Admin -hap 661/tcp -hap 661/udp -pftp 662/tcp -pftp 662/udp -purenoise 663/tcp #PureNoise -purenoise 663/udp #PureNoise -asf-secure-rmcp 664/tcp #ASF Secure Remote Management and Control Protocol -asf-secure-rmcp 664/udp #ASF Secure Remote Management and Control Protocol -sun-dr 665/tcp #Sun DR -sun-dr 665/udp #Sun DR +mac-srvr-admin 660/tcp #MacOS Server Admin +mac-srvr-admin 660/udp #MacOS Server Admin +hap 661/tcp +hap 661/udp +pftp 662/tcp +pftp 662/udp +purenoise 663/tcp #PureNoise +purenoise 663/udp #PureNoise +asf-secure-rmcp 664/tcp #ASF Secure Remote Management and Control Protocol +asf-secure-rmcp 664/udp #ASF Secure Remote Management and Control Protocol +sun-dr 665/tcp #Sun DR +sun-dr 665/udp #Sun DR mdqs 666/tcp mdqs 666/udp #PROBLEMS!=============================================== doom 666/tcp #doom Id Software doom 666/udp #doom Id Software #PROBLEMS!=============================================== -disclose 667/tcp #campaign contribution disclosures - SDR Technologies -disclose 667/udp #campaign contribution disclosures - SDR Technologies -mecomm 668/tcp -mecomm 668/udp -meregister 669/tcp -meregister 669/udp -vacdsm-sws 670/tcp -vacdsm-sws 670/udp -vacdsm-app 671/tcp -vacdsm-app 671/udp -vpps-qua 672/tcp -vpps-qua 672/udp -cimplex 673/tcp -cimplex 673/udp +disclose 667/tcp #campaign contribution disclosures - SDR Technologies +disclose 667/udp #campaign contribution disclosures - SDR Technologies +mecomm 668/tcp +mecomm 668/udp +meregister 669/tcp +meregister 669/udp +vacdsm-sws 670/tcp +vacdsm-sws 670/udp +vacdsm-app 671/tcp +vacdsm-app 671/udp +vpps-qua 672/tcp +vpps-qua 672/udp +cimplex 673/tcp +cimplex 673/udp acap 674/tcp #Application Configuration Access Protocol acap 674/udp #Application Configuration Access Protocol dctp 675/tcp @@ -1257,70 +1257,70 @@ vpp 677/tcp #Virtual Presence Protoc vpp 677/udp #Virtual Presence Protocol ggf-ncp 678/tcp #GNU Generation Foundation NCP ggf-ncp 678/udp #GNU Generation Foundation NCP -mrm 679/tcp -mrm 679/udp +mrm 679/tcp +mrm 679/udp entrust-aaas 680/tcp entrust-aaas 680/udp entrust-aams 681/tcp entrust-aams 681/udp -xfr 682/tcp -xfr 682/udp -corba-iiop 683/tcp #CORBA IIOP -corba-iiop 683/udp #CORBA IIOP +xfr 682/tcp +xfr 682/udp +corba-iiop 683/tcp #CORBA IIOP +corba-iiop 683/udp #CORBA IIOP corba-iiop-ssl 684/tcp #CORBA IIOP SSL corba-iiop-ssl 684/udp #CORBA IIOP SSL mdc-portmapper 685/tcp #MDC Port Mapper mdc-portmapper 685/udp #MDC Port Mapper -hcp-wismar 686/tcp #Hardware Control Protocol Wismar -hcp-wismar 686/udp #Hardware Control Protocol Wismar +hcp-wismar 686/tcp #Hardware Control Protocol Wismar +hcp-wismar 686/udp #Hardware Control Protocol Wismar asipregistry 687/tcp asipregistry 687/udp -realm-rusd 688/tcp #ApplianceWare management protocol -realm-rusd 688/udp #ApplianceWare management protocol -nmap 689/tcp -nmap 689/udp -vatp 690/tcp #Velazquez Application Transfer Protocol -vatp 690/udp #Velazquez Application Transfer Protocol +realm-rusd 688/tcp #ApplianceWare management protocol +realm-rusd 688/udp #ApplianceWare management protocol +nmap 689/tcp +nmap 689/udp +vatp 690/tcp #Velazquez Application Transfer Protocol +vatp 690/udp #Velazquez Application Transfer Protocol msexch-routing 691/tcp #MS Exchange Routing msexch-routing 691/udp #MS Exchange Routing hyperwave-isp 692/tcp #Hyperwave-ISP hyperwave-isp 692/udp #Hyperwave-ISP -connendp 693/tcp -connendp 693/udp -ha-cluster 694/tcp -ha-cluster 694/udp -ieee-mms-ssl 695/tcp -ieee-mms-ssl 695/udp -rushd 696/tcp -rushd 696/udp -uuidgen 697/tcp -uuidgen 697/udp -olsr 698/tcp -olsr 698/udp -accessnetwork 699/tcp #Access Network -accessnetwork 699/udp #Access Network -epp 700/tcp #Extensible Provisioning Protocol -epp 700/udp #Extensible Provisioning Protocol -lmp 701/tcp #Link Management Protocol (LMP) -lmp 701/udp #Link Management Protocol (LMP) -iris-beep 702/tcp #IRIS over BEEP -iris-beep 702/udp #IRIS over BEEP +connendp 693/tcp +connendp 693/udp +ha-cluster 694/tcp +ha-cluster 694/udp +ieee-mms-ssl 695/tcp +ieee-mms-ssl 695/udp +rushd 696/tcp +rushd 696/udp +uuidgen 697/tcp +uuidgen 697/udp +olsr 698/tcp +olsr 698/udp +accessnetwork 699/tcp #Access Network +accessnetwork 699/udp #Access Network +epp 700/tcp #Extensible Provisioning Protocol +epp 700/udp #Extensible Provisioning Protocol +lmp 701/tcp #Link Management Protocol (LMP) +lmp 701/udp #Link Management Protocol (LMP) +iris-beep 702/tcp #IRIS over BEEP +iris-beep 702/udp #IRIS over BEEP elcsd 704/tcp #errlog copy/server daemon elcsd 704/udp #errlog copy/server daemon -agentx 705/tcp #AgentX -agentx 705/udp #AgentX -silc 706/tcp -silc 706/udp -borland-dsj 707/tcp #Borland DSJ -borland-dsj 707/udp #Borland DSJ +agentx 705/tcp #AgentX +agentx 705/udp #AgentX +silc 706/tcp +silc 706/udp +borland-dsj 707/tcp #Borland DSJ +borland-dsj 707/udp #Borland DSJ entrustmanager 709/tcp #EntrustManager entrustmanager 709/udp #EntrustManager -entrust-ash 710/tcp #Entrust Administration Service Handler -entrust-ash 710/udp #Entrust Administration Service Handler -cisco-tdp 711/tcp #Cisco TDP -cisco-tdp 711/udp #Cisco TDP -tbrpf 712/tcp -tbrpf 712/udp +entrust-ash 710/tcp #Entrust Administration Service Handler +entrust-ash 710/udp #Entrust Administration Service Handler +cisco-tdp 711/tcp #Cisco TDP +cisco-tdp 711/udp #Cisco TDP +tbrpf 712/tcp +tbrpf 712/udp iris-xpc 713/tcp #IRIS over XPC iris-xpc 713/udp #IRIS over XPC iris-xpcs 714/tcp #IRIS over XPCS @@ -1419,49 +1419,49 @@ fcp-udp 810/udp #FCP Datagram itm-mcell-s 828/tcp itm-mcell-s 828/udp pkix-3-ca-ra 829/tcp #PKIX-3 CA/RA -pkix-3-ca-ra 829/udp #PKIX-3 CA/RA -netconf-ssh 830/tcp #NETCONF over SSH -netconf-ssh 830/udp #NETCONF over SSH -netconf-beep 831/tcp #NETCONF over BEEP -netconf-beep 831/udp #NETCONF over BEEP -netconfsoaphttp 832/tcp #NETCONF for SOAP over HTTPS -netconfsoaphttp 832/udp #NETCONF for SOAP over HTTPS -netconfsoapbeep 833/tcp #NETCONF for SOAP over BEEP -netconfsoapbeep 833/udp #NETCONF for SOAP over BEEP -dhcp-failover2 847/tcp #dhcp-failover 2 -dhcp-failover2 847/udp #dhcp-failover 2 -gdoi 848/tcp -gdoi 848/udp -iscsi 860/tcp -iscsi 860/udp -owamp-control 861/tcp -owamp-control 861/udp +pkix-3-ca-ra 829/udp #PKIX-3 CA/RA +netconf-ssh 830/tcp #NETCONF over SSH +netconf-ssh 830/udp #NETCONF over SSH +netconf-beep 831/tcp #NETCONF over BEEP +netconf-beep 831/udp #NETCONF over BEEP +netconfsoaphttp 832/tcp #NETCONF for SOAP over HTTPS +netconfsoaphttp 832/udp #NETCONF for SOAP over HTTPS +netconfsoapbeep 833/tcp #NETCONF for SOAP over BEEP +netconfsoapbeep 833/udp #NETCONF for SOAP over BEEP +dhcp-failover2 847/tcp #dhcp-failover 2 +dhcp-failover2 847/udp #dhcp-failover 2 +gdoi 848/tcp +gdoi 848/udp +iscsi 860/tcp +iscsi 860/udp +owamp-control 861/tcp +owamp-control 861/udp supfilesrv 871/tcp # for SUP rsync 873/tcp rsync 873/udp -iclcnet-locate 886/tcp #ICL coNETion locate server -iclcnet-locate 886/udp #ICL coNETion locate server -iclcnet_svinfo 887/tcp #ICL coNETion server info -iclcnet_svinfo 887/udp #ICL coNETion server info +iclcnet-locate 886/tcp #ICL coNETion locate server +iclcnet-locate 886/udp #ICL coNETion locate server +iclcnet_svinfo 887/tcp #ICL coNETion server info +iclcnet_svinfo 887/udp #ICL coNETion server info accessbuilder 888/tcp accessbuilder 888/udp -omginitialrefs 900/tcp #OMG Initial Refs -omginitialrefs 900/udp #OMG Initial Refs +omginitialrefs 900/tcp #OMG Initial Refs +omginitialrefs 900/udp #OMG Initial Refs swat 901/tcp # samba web configuration tool -smpnameres 901/tcp -smpnameres 901/udp -ideafarm-chat 902/tcp -ideafarm-chat 902/udp -ideafarm-catch 903/tcp -ideafarm-catch 903/udp -kink 910/tcp #Kerberized Internet Negotiation of Keys (KINK) -kink 910/udp #Kerberized Internet Negotiation of Keys (KINK) -xact-backup 911/tcp -xact-backup 911/udp -apex-mesh 912/tcp #APEX relay-relay service -apex-mesh 912/udp #APEX relay-relay service -apex-edge 913/tcp #APEX endpoint-relay service -apex-edge 913/udp #APEX endpoint-relay service +smpnameres 901/tcp +smpnameres 901/udp +ideafarm-chat 902/tcp +ideafarm-chat 902/udp +ideafarm-catch 903/tcp +ideafarm-catch 903/udp +kink 910/tcp #Kerberized Internet Negotiation of Keys (KINK) +kink 910/udp #Kerberized Internet Negotiation of Keys (KINK) +xact-backup 911/tcp +xact-backup 911/udp +apex-mesh 912/tcp #APEX relay-relay service +apex-mesh 912/udp #APEX relay-relay service +apex-edge 913/tcp #APEX endpoint-relay service +apex-edge 913/udp #APEX endpoint-relay service rndc 953/tcp # named's rndc control socket ftps-data 989/tcp # ftp protocol, data, over TLS/SSL ftps-data 989/udp @@ -1491,10 +1491,10 @@ cadlock2 1000/tcp cadlock2 1000/udp surf 1010/tcp surf 1010/udp -exp1 1021/tcp #RFC3692-style Experiment 1 (*) [RFC4727] -exp1 1021/udp #RFC3692-style Experiment 1 (*) [RFC4727] -exp2 1022/tcp #RFC3692-style Experiment 2 (*) [RFC4727] -exp2 1022/udp #RFC3692-style Experiment 2 (*) [RFC4727] +exp1 1021/tcp #RFC3692-style Experiment 1 (*) [RFC4727] +exp1 1021/udp #RFC3692-style Experiment 1 (*) [RFC4727] +exp2 1022/tcp #RFC3692-style Experiment 2 (*) [RFC4727] +exp2 1022/udp #RFC3692-style Experiment 2 (*) [RFC4727] # # REGISTERED PORT NUMBERS # @@ -2399,6 +2399,7 @@ xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unofficial) +ircs-u 6697/tcp #Internet Relay Chat over TLS/SSL frc-hp 6704/sctp #ForCES HP (High Priority) channel frc-mp 6705/sctp #ForCES MP (Medium Priority) channel frc-lp 6706/sctp #ForCES LP (Low priority) channel Modified: user/ngie/stable-10-libnv/gnu/usr.bin/Makefile ============================================================================== --- user/ngie/stable-10-libnv/gnu/usr.bin/Makefile Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/gnu/usr.bin/Makefile Tue Dec 29 01:21:40 2015 (r292857) @@ -17,6 +17,8 @@ SUBDIR= ${_binutils} \ ${_tests} \ ${_texinfo} +SUBDIR_DEPEND_gdb= ${_binutils} + .if ${MK_CXX} != "no" _gperf= gperf .if ${MK_GROFF} != "no" Modified: user/ngie/stable-10-libnv/include/netdb.h ============================================================================== --- user/ngie/stable-10-libnv/include/netdb.h Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/include/netdb.h Tue Dec 29 01:21:40 2015 (r292857) @@ -122,7 +122,7 @@ struct protoent { struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */ - int ai_family; /* PF_xxx */ + int ai_family; /* AF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ socklen_t ai_addrlen; /* length of ai_addr */ @@ -179,7 +179,7 @@ struct addrinfo { /* valid flags for addrinfo (not a standard def, apps should not use it) */ #define AI_MASK \ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ - AI_ADDRCONFIG) + AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED) #define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ #define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ Modified: user/ngie/stable-10-libnv/lib/libc/gen/lockf.c ============================================================================== --- user/ngie/stable-10-libnv/lib/libc/gen/lockf.c Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/lib/libc/gen/lockf.c Tue Dec 29 01:21:40 2015 (r292857) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <fcntl.h> #include <unistd.h> #include "un-namespace.h" +#include "libc_private.h" int lockf(int filedes, int function, off_t size) @@ -62,9 +63,12 @@ lockf(int filedes, int function, off_t s break; case F_TEST: fl.l_type = F_WRLCK; - if (_fcntl(filedes, F_GETLK, &fl) == -1) + if (((int (*)(int, int, ...)) + __libc_interposing[INTERPOS_fcntl])(filedes, F_GETLK, &fl) + == -1) return (-1); - if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && fl.l_pid == getpid())) + if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && + fl.l_pid == getpid())) return (0); errno = EAGAIN; return (-1); @@ -75,5 +79,6 @@ lockf(int filedes, int function, off_t s /* NOTREACHED */ } - return (_fcntl(filedes, cmd, &fl)); + return (((int (*)(int, int, ...)) + __libc_interposing[INTERPOS_fcntl])(filedes, cmd, &fl)); } Modified: user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.3 ============================================================================== --- user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.3 Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.3 Tue Dec 29 01:21:40 2015 (r292857) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2015 +.Dd December 21, 2015 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -78,7 +78,7 @@ as defined by .Bd -literal struct addrinfo { int ai_flags; /* input flags */ - int ai_family; /* protocol family for socket */ + int ai_family; /* address family for socket */ int ai_socktype; /* socket type */ int ai_protocol; /* protocol for socket */ socklen_t ai_addrlen; /* length of socket-address */ @@ -94,12 +94,12 @@ The caller can supply the following stru .Fa hints : .Bl -tag -width "ai_socktypeXX" .It Fa ai_family -The protocol family that should be used. +The address family that should be used. When .Fa ai_family is set to -.Dv PF_UNSPEC , -it means the caller will accept any protocol family supported by the +.Dv AF_UNSPEC , +it means the caller will accept any address family supported by the operating system. .It Fa ai_socktype Denotes the type of socket that is wanted: @@ -126,11 +126,13 @@ field to which the parameter points shall be set to zero or be the bitwise-inclusive OR of one or more of the values .Dv AI_ADDRCONFIG , +.Dv AI_ALL , .Dv AI_CANONNAME , .Dv AI_NUMERICHOST , -.Dv AI_NUMERICSERV +.Dv AI_NUMERICSERV , +.Dv AI_PASSIVE and -.Dv AI_PASSIVE . +.Dv AI_V4MAPPED . .Bl -tag -width "AI_CANONNAMEXX" .It Dv AI_ADDRCONFIG If the @@ -139,6 +141,25 @@ bit is set, IPv4 addresses shall be retu an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. +.It Dv AI_ALL +If the +.Dv AI_ALL +flag is used with the +.Dv AI_V4MAPPED +flag, then +.Fn getaddrinfo +shall return all matching IPv6 and IPv4 addresses. +.Pp +For example, when using the DNS, queries are made for both AAAA records and A records, and +.Fn getaddrinfo +returns the combined results of both queries. +Any IPv4 addresses found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_ALL +flag without the +.Dv AI_V4MAPPED +flag is ignored. .It Dv AI_CANONNAME If the .Dv AI_CANONNAME @@ -203,6 +224,25 @@ loopback address if is the null pointer and .Dv AI_PASSIVE is not set. +.It Dv AI_V4MAPPED +If the +.Dv AI_V4MAPPED +flag is specified along with an ai_family of +.Dv AF_INET6 , +then +.Fn getaddrinfo +shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses ( +.Fa ai_addrlen +shall be 16). +.Pp +For example, when using the DNS, if no AAAA records are found then a query is made for A records and any found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_V4MAPPED +flag shall be ignored unless +.Fa ai_family +equals +.Dv AF_INET6 . .El .El .Pp @@ -221,7 +261,7 @@ behaves as if the caller provided a with .Fa ai_family set to -.Dv PF_UNSPEC +.Dv AF_UNSPEC and all other elements set to zero or .Dv NULL . .Pp @@ -333,7 +373,7 @@ int s; const char *cause = NULL; memset(&hints, 0, sizeof(hints)); -hints.ai_family = PF_UNSPEC; +hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("www.kame.net", "http", &hints, &res0); if (error) { @@ -376,7 +416,7 @@ int nsock; const char *cause = NULL; memset(&hints, 0, sizeof(hints)); -hints.ai_family = PF_UNSPEC; +hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; error = getaddrinfo(NULL, "http", &hints, &res0); Modified: user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.c ============================================================================== --- user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.c Tue Dec 29 01:09:53 2015 (r292856) +++ user/ngie/stable-10-libnv/lib/libc/net/getaddrinfo.c Tue Dec 29 01:21:40 2015 (r292857) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include <stdarg.h> #include <nsswitch.h> #include "un-namespace.h" +#include "netdb_private.h" #include "libc_private.h" #ifdef NS_CACHING #include "nscache.h" @@ -451,6 +452,24 @@ getaddrinfo(const char *hostname, const } /* + * RFC 3493: AI_ALL and AI_V4MAPPED are effective only against + * AF_INET6 query. They need to be ignored if specified in other + * occassions. + */ + switch (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) { + case AI_V4MAPPED: + case AI_ALL | AI_V4MAPPED: +#ifdef INET6 + if (pai->ai_family != AF_INET6) + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; +#endif + case AI_ALL: + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; + } + + /* * check for special cases. (1) numeric servname is disallowed if * socktype/protocol are left unspecified. (2) servname is disallowed * for raw and other inet{,6} sockets. @@ -759,10 +778,9 @@ match_addrselectpolicy(struct sockaddr * memset(&key, 0, sizeof(key)); key.sin6_family = AF_INET6; key.sin6_len = sizeof(key); - key.sin6_addr.s6_addr[10] = 0xff; - key.sin6_addr.s6_addr[11] = 0xff; - memcpy(&key.sin6_addr.s6_addr[12], - &((struct sockaddr_in *)addr)->sin_addr, 4); + _map_v4v6_address( + (char *)&((struct sockaddr_in *)addr)->sin_addr, + (char *)&key.sin6_addr); break; default: return(NULL); @@ -842,6 +860,16 @@ set_source(struct ai_order *aio, struct if ((s = _socket(ai.ai_family, ai.ai_socktype | SOCK_CLOEXEC, ai.ai_protocol)) < 0) return; /* give up */ +#ifdef INET6 + if (ai.ai_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)ai.ai_addr; + int off = 0; + + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + (void)_setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, + (char *)&off, sizeof(off)); + } +#endif if (_connect(s, ai.ai_addr, ai.ai_addrlen) < 0) goto cleanup; srclen = ai.ai_addrlen; @@ -1177,7 +1205,7 @@ explore_numeric(const struct addrinfo *p const char *servname, struct addrinfo **res, const char *canonname) { const struct afd *afd; - struct addrinfo *ai; + struct addrinfo *ai, ai0; int error; char pton[PTON_MAX]; @@ -1201,8 +1229,17 @@ explore_numeric(const struct addrinfo *p return 0; break; default: - if (inet_pton(afd->a_af, hostname, pton) != 1) - return 0; + if (inet_pton(afd->a_af, hostname, pton) != 1) { + if (pai->ai_family != AF_INET6 || + (pai->ai_flags & AI_V4MAPPED) != AI_V4MAPPED) + return 0; + if (inet_aton(hostname, (struct in_addr *)pton) != 1) + return 0; + afd = &afdl[N_INET]; + ai0 = *pai; + ai0.ai_family = AF_INET; + pai = &ai0; + } break; } @@ -1321,6 +1358,9 @@ get_ai(const struct addrinfo *pai, const char *fp_str; int translate = 0; #endif +#ifdef INET6 + struct in6_addr mapaddr; +#endif #ifdef FAITH /* @@ -1358,6 +1398,14 @@ get_ai(const struct addrinfo *pai, const } #endif +#ifdef INET6 + if (afd->a_af == AF_INET && (pai->ai_flags & AI_V4MAPPED) != 0) { + afd = &afdl[N_INET6]; + _map_v4v6_address(addr, (char *)&mapaddr); + addr = (char *)&mapaddr; + } +#endif + ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + (afd->a_socklen)); if (ai == NULL) @@ -2117,7 +2165,11 @@ getanswer(const querybuf *answer, int an return sentinel.ai_next; } - RES_SET_H_ERRNO(res, NO_RECOVERY); + /* + * We could have walked a CNAME chain, but the ultimate target + * may not have what we looked for. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512290121.tBT1LfL5022035>