Hi Matt,

  please have a look at the appended diff. Basically, I have just
changed all "family hints" from AF_UNSPEC to AF_INET (IPv4). After this
change the "0.0.0.0" problem went away. Apparently Solaris ( and
Mac/OS) do IPv6 first if  AF_UNSPEC is given in a call to "socket". I
have not checked, which of the modifications actually did it for me.

 I am not sure how this will behave on a system that does only IPv6.
Unfortunatelly I have no chance to test it. Likely/hopefully it will
just "do the right thing".

 Also, for local communication my change will/may prevent to use of
UNIX type sockets.

 Again, this may not be the solution. It just hints on why the family
was set to IPv6. The proper solution is to handle the IPv6 case right
in gmond/server.c. On the other hand, that kind of detail does not
belong there (IMO).

Cheers
Martin

bash-2.03$ diff -ur monitor-core monitor-core-ipv4
diff -ur monitor-core/libunp/getaddrinfo.c
monitor-core-ipv4/libunp/getaddrinfo.c
--- monitor-core/libunp/getaddrinfo.c   2004-02-26 01:36:31.000000000
+0100
+++ monitor-core-ipv4/libunp/getaddrinfo.c      2004-06-09
10:24:30.343275000 +0200
@@ -31,7 +31,7 @@

        if (hintsp == NULL) {
                bzero(&hints, sizeof(hints));
-               hints.ai_family = AF_UNSPEC;
+               hints.ai_family = AF_INET;
        } else
                hints = *hintsp;                /* struct copy */

Only in monitor-core-ipv4/libunp: getaddrinfo.c-org
diff -ur monitor-core/libunp/tcp_connect.c
monitor-core-ipv4/libunp/tcp_connect.c
--- monitor-core/libunp/tcp_connect.c   2004-04-30 20:02:31.000000000
+0200
+++ monitor-core-ipv4/libunp/tcp_connect.c      2004-06-09
10:25:50.630798000 +0200
@@ -8,7 +8,7 @@
        struct addrinfo hints, *res, *ressave;

        bzero(&hints, sizeof(struct addrinfo));
-       hints.ai_family = AF_UNSPEC;
+       hints.ai_family = AF_INET;
        hints.ai_socktype = SOCK_STREAM;

        if ( (n = getaddrinfo(host, serv, &hints, &res)) != 0)
diff -ur monitor-core/libunp/tcp_listen.c
monitor-core-ipv4/libunp/tcp_listen.c
--- monitor-core/libunp/tcp_listen.c    2004-04-30 20:02:31.000000000
+0200
+++ monitor-core-ipv4/libunp/tcp_listen.c       2004-06-09
10:27:25.688425000 +0200
@@ -10,7 +10,7 @@

        bzero(&hints, sizeof(struct addrinfo));
        hints.ai_flags = AI_PASSIVE;
-       hints.ai_family = AF_UNSPEC;
+       hints.ai_family = AF_INET;
        hints.ai_socktype = SOCK_STREAM;

        if ( (n = getaddrinfo(host, serv, &hints, &res)) != 0)
diff -ur monitor-core/libunp/udp_client.c
monitor-core-ipv4/libunp/udp_client.c
--- monitor-core/libunp/udp_client.c    2004-04-30 20:02:31.000000000
+0200
+++ monitor-core-ipv4/libunp/udp_client.c       2004-06-09
10:30:56.898624000 +0200
@@ -8,7 +8,7 @@
        struct addrinfo hints, *res, *ressave;

        bzero(&hints, sizeof(struct addrinfo));
-       hints.ai_family = AF_UNSPEC;
+       hints.ai_family = AF_INET;
        hints.ai_socktype = SOCK_DGRAM;

        if ( (n = getaddrinfo(host, serv, &hints, &res)) != 0)
diff -ur monitor-core/libunp/udp_connect.c
monitor-core-ipv4/libunp/udp_connect.c
--- monitor-core/libunp/udp_connect.c   2004-04-30 20:02:31.000000000
+0200
+++ monitor-core-ipv4/libunp/udp_connect.c      2004-06-09
10:28:37.311607000 +0200
@@ -8,7 +8,7 @@
        struct addrinfo hints, *res, *ressave;

        bzero(&hints, sizeof(struct addrinfo));
-       hints.ai_family = AF_UNSPEC;
+       hints.ai_family = AF_INET;
        hints.ai_socktype = SOCK_DGRAM;

        if ( (n = getaddrinfo(host, serv, &hints, &res)) != 0)
diff -ur monitor-core/libunp/udp_server.c
monitor-core-ipv4/libunp/udp_server.c
--- monitor-core/libunp/udp_server.c    2004-04-30 20:02:31.000000000
+0200
+++ monitor-core-ipv4/libunp/udp_server.c       2004-06-09
10:29:55.422103000 +0200
@@ -9,7 +9,7 @@

        bzero(&hints, sizeof(struct addrinfo));
        hints.ai_flags = AI_PASSIVE;
-       hints.ai_family = AF_UNSPEC;
+       hints.ai_family = AF_INET;
        hints.ai_socktype = SOCK_DGRAM;

        if ( (n = getaddrinfo(host, serv, &hints, &res)) != 0)





=====
------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www:   http://www.knobisoft.de

Reply via email to