Bugzilla – Attachment 2739 Details for
Bug 2483
use AI_ADDRCONFIG flag for getaddrinfo() hints on Solaris
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
the proposed patch
getaddrinfo_with_ai_addrconfig.patch (text/plain), 7.48 KB, created by
Ivo Raisr
on 2015-10-27 08:02:50 AEDT
(
hide
)
Description:
the proposed patch
Filename:
MIME Type:
Creator:
Ivo Raisr
Created:
2015-10-27 08:02:50 AEDT
Size:
7.48 KB
patch
obsolete
># Use AI_ADDRCONFIG flag for getaddrinfo() hints where applicable. ># > >--- a/configure.ac Sat Oct 24 12:30:57 2015 >+++ b/configure.ac Sat Oct 24 12:31:47 2015 >@@ -905,6 +905,7 @@ > AC_DEFINE([USE_GSS_STORE_CRED]) > AC_DEFINE([GSSAPI_STORECREDS_NEEDS_RUID]) > AC_DEFINE([HAVE_PAM_AUSER]) >+ AC_DEFINE([HAVE_AI_ADDRCONFIG]) > ;; > *-*-sunos4*) > CPPFLAGS="$CPPFLAGS -DSUNOS4" >--- a/configure Sat Oct 24 12:30:48 2015 >+++ b/configure Sat Oct 24 12:32:07 2015 >@@ -10873,6 +10873,7 @@ > #define USE_GSS_STORE_CRED 1 > #define GSSAPI_STORECREDS_NEEDS_RUID 1 > #define HAVE_PAM_AUSER 1 >+#define HAVE_AI_ADDRCONFIG 1 > _ACEOF > > TEST_SHELL=$SHELL # let configure find us a capable shell >--- a/config.h.in Sat Oct 24 12:33:29 2015 >+++ b/config.h.in Sat Oct 24 12:36:15 2015 >@@ -177,6 +177,9 @@ > /* Define if you have ut_addr_v6 in utmpx.h */ > #undef HAVE_ADDR_V6_IN_UTMPX > >+/* Define if you have AI_ADDRCONFIG flag for getaddrinfo() hints */ >+#undef HAVE_AI_ADDRCONFIG >+ > /* Define to 1 if you have the `arc4random' function. */ > #undef HAVE_ARC4RANDOM > >--- a/canohost.c Sun Oct 25 20:11:35 2015 >+++ b/canohost.c Sun Oct 25 20:11:57 2015 >@@ -113,6 +113,10 @@ > memset(&hints, 0, sizeof(hints)); > hints.ai_family = from.ss_family; > hints.ai_socktype = SOCK_STREAM; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags = AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > if (getaddrinfo(name, NULL, &hints, &aitop) != 0) { > logit("reverse mapping checking getaddrinfo for %.700s " > "[%s] failed - POSSIBLE BREAK-IN ATTEMPT!", name, ntop); >--- a/channels.c Sun Oct 25 19:30:33 2015 >+++ b/channels.c Sun Oct 25 19:54:36 2015 >@@ -2830,8 +2830,12 @@ > */ > memset(&hints, 0, sizeof(hints)); > hints.ai_family = IPv4or6; >- hints.ai_flags = wildcard ? AI_PASSIVE : 0; > hints.ai_socktype = SOCK_STREAM; >+ hints.ai_flags = wildcard ? AI_PASSIVE : 0; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > snprintf(strport, sizeof strport, "%d", fwd->listen_port); > if ((r = getaddrinfo(addr, strport, &hints, &aitop)) != 0) { > if (addr == NULL) { >@@ -3713,6 +3717,10 @@ > memset(&hints, 0, sizeof(hints)); > hints.ai_family = IPv4or6; > hints.ai_socktype = SOCK_STREAM; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags = AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > snprintf(strport, sizeof strport, "%d", port); > if ((gaierr = getaddrinfo(name, strport, &hints, &cctx.aitop)) != 0) { > error("connect_to %.100s: unknown host (%s)", name, >@@ -3885,8 +3893,12 @@ > port = 6000 + display_number; > memset(&hints, 0, sizeof(hints)); > hints.ai_family = IPv4or6; >- hints.ai_flags = x11_use_localhost ? 0: AI_PASSIVE; > hints.ai_socktype = SOCK_STREAM; >+ hints.ai_flags = x11_use_localhost ? 0: AI_PASSIVE; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > snprintf(strport, sizeof strport, "%d", port); > if ((gaierr = getaddrinfo(NULL, strport, &hints, &aitop)) != 0) { > error("getaddrinfo: %.100s", ssh_gai_strerror(gaierr)); >@@ -4067,6 +4079,10 @@ > memset(&hints, 0, sizeof(hints)); > hints.ai_family = IPv4or6; > hints.ai_socktype = SOCK_STREAM; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags = AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > snprintf(strport, sizeof strport, "%u", 6000 + display_number); > if ((gaierr = getaddrinfo(buf, strport, &hints, &aitop)) != 0) { > error("%.100s: unknown host. (%s)", buf, >--- a/servconf.c Sun Oct 25 19:39:38 2015 >+++ b/servconf.c Sun Oct 25 19:45:16 2015 >@@ -694,6 +694,10 @@ > hints.ai_family = options->address_family; > hints.ai_socktype = SOCK_STREAM; > hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > snprintf(strport, sizeof strport, "%d", port); > if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) > fatal("bad addr or host: %s (%s)", >--- a/ssh-keyscan.c Sun Oct 25 19:46:28 2015 >+++ b/ssh-keyscan.c Sun Oct 25 19:54:55 2015 >@@ -323,6 +323,10 @@ > memset(&hints, 0, sizeof(hints)); > hints.ai_family = IPv4or6; > hints.ai_socktype = SOCK_STREAM; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags = AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) { > error("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr)); > return -1; >--- a/ssh.c Sun Oct 25 19:49:46 2015 >+++ b/ssh.c Sun Oct 25 19:55:15 2015 >@@ -258,6 +258,10 @@ > hints.ai_socktype = SOCK_STREAM; > if (cname != NULL) > hints.ai_flags = AI_CANONNAME; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > if ((gaierr = getaddrinfo(name, strport, &hints, &res)) != 0) { > if (logerr || (gaierr != EAI_NONAME && gaierr != EAI_NODATA)) > loglevel = SYSLOG_LEVEL_ERROR; >@@ -297,6 +301,10 @@ > AF_UNSPEC : options.address_family; > hints.ai_socktype = SOCK_STREAM; > hints.ai_flags = AI_NUMERICHOST|AI_NUMERICSERV; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > if ((gaierr = getaddrinfo(name, strport, &hints, &res)) != 0) { > debug2("%s: could not resolve name %.100s as address: %s", > __func__, name, ssh_gai_strerror(gaierr)); >--- a/sshconnect.c Sun Oct 25 19:57:46 2015 >+++ b/sshconnect.c Sun Oct 25 19:58:19 2015 >@@ -292,6 +292,10 @@ > hints.ai_socktype = ai->ai_socktype; > hints.ai_protocol = ai->ai_protocol; > hints.ai_flags = AI_PASSIVE; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > gaierr = getaddrinfo(options.bind_address, NULL, &hints, &res); > if (gaierr) { > error("getaddrinfo: %s: %s", options.bind_address, >--- a/regress/netcat.c Sun Oct 25 19:59:44 2015 >+++ b/regress/netcat.c Sun Oct 25 20:07:05 2015 >@@ -365,6 +365,10 @@ > hints.ai_protocol = uflag ? IPPROTO_UDP : IPPROTO_TCP; > if (nflag) > hints.ai_flags |= AI_NUMERICHOST; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > } > > if (xflag) { >@@ -393,6 +397,10 @@ > proxyhints.ai_protocol = IPPROTO_TCP; > if (nflag) > proxyhints.ai_flags |= AI_NUMERICHOST; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (proxyhints.ai_family == AF_UNSPEC) >+ proxyhints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > } > > if (lflag) { >@@ -667,6 +675,10 @@ > ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; > ahints.ai_protocol = uflag ? IPPROTO_UDP : IPPROTO_TCP; > ahints.ai_flags = AI_PASSIVE; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (ahints.ai_family == AF_UNSPEC) >+ ahints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > if ((error = getaddrinfo(sflag, pflag, &ahints, &ares))) > errx(1, "getaddrinfo: %s", gai_strerror(error)); > >@@ -1416,8 +1428,12 @@ > > bzero(&hints, sizeof(hints)); > hints.ai_family = v4only ? PF_INET : PF_UNSPEC; >- hints.ai_flags = numeric ? AI_NUMERICHOST : 0; > hints.ai_socktype = SOCK_STREAM; >+ hints.ai_flags = numeric ? AI_NUMERICHOST : 0; >+#ifdef HAVE_AI_ADDRCONFIG >+ if (hints.ai_family == AF_UNSPEC) >+ hints.ai_flags |= AI_ADDRCONFIG; >+#endif /* HAVE_AI_ADDRCONFIG */ > r = getaddrinfo(h, p, &hints, &res); > /* Don't fatal when attempting to convert a numeric address */ > if (r != 0) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2483
:
2739
|
2743