gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-292


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-2921-gc1e55fd
Date: Fri, 9 Feb 2018 04:31:44 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-4.2-stable has been updated
       via  c1e55fde1a4bb72a0627ab37fe5ba1493cbf91eb (commit)
      from  c326b7dfa00760f7127912053fad544b0b79da23 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=c1e55fde1a4bb72a0627ab37fe5ba1493cbf91eb

commit c1e55fde1a4bb72a0627ab37fe5ba1493cbf91eb
Author: Arnold D. Robbins <address@hidden>
Date:   Fri Feb 9 11:31:25 2018 +0200

    Small fix in sockets if only loopback interface is up.

diff --git a/ChangeLog b/ChangeLog
index a5fd076..b467eb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-02-09         Arnold D. Robbins     <address@hidden>
+
+       * io.c (socketopen): Rearrange assigning the flags to use
+       AI_ADDRCONFIG only if family is AF_UNSPEC. Thanks to
+       Houder <address@hidden> for the report and initial
+       code suggestion.
+
 2018-02-07         Andrew J. Schorr      <address@hidden>
 
        Print +"01" should print "1", not "01".
diff --git a/io.c b/io.c
index befc20a..f09c4a0 100644
--- a/io.c
+++ b/io.c
@@ -1579,10 +1579,23 @@ socketopen(int family, int type, const char *localpname,
        int any_remote_host = (strcmp(remotehostname, "0") == 0);
 
        memset(& lhints, '\0', sizeof (lhints));
-       lhints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
+
        lhints.ai_socktype = type;
        lhints.ai_family = family;
 
+       /*
+         * If only the loopback interface is up and hints.ai_flags has
+        * AI_ADDRCONFIG, getaddrinfo() will succeed and return all wildcard
+        * addresses, but only if hints.ai_family == AF_UNSPEC
+        *
+        * Do return the wildcard address in case the loopback interface
+        * is the only one that is up (and
+        * hints.ai_family == either AF_INET4 or AF_INET6)
+         */
+       lhints.ai_flags = AI_PASSIVE;
+       if (lhints.ai_family == AF_UNSPEC)
+               lhints.ai_flags |= AI_ADDRCONFIG;
+
        lerror = getaddrinfo(NULL, localpname, & lhints, & lres);
        if (lerror) {
                if (strcmp(localpname, "0") != 0) {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog |  7 +++++++
 io.c      | 15 ++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]